|
From: Stefan S. <se...@sy...> - 2005-06-05 13:45:50
|
Hi Gunther,
Gunther Laure wrote:
> template<typename _CharT>
> template<class Foo>
> void basic_string<_CharT>::test(Foo a)
> {
> cout << "Foo" << endl;
> }
>
> In this case the impl parameter of TranslateTemplateFunction does not
> contain the valid implementation:
> Dump: [0 [void] [[test ( [[Foo [a]]] )]] ;]
>
> The cast to PtreeDeclarator fails in this case...
It is quite possible that you have hit one of the limitations of the
OpenC++ parser, which are all symptoms of the same fundamental issue:
As it doesn't lookup symbols during the parsing, it can't disambiguate
certain constructs and thus has to guess whether it is looking at
a type-id or an expression (whether '>' marks the end of a template-id
or is the relational operator), etc., etc.
> Another question:
> Whats the difference between PTreeDeclaration and PTreeDeclarator?
To see what the difference between 'declaration' and 'declarator' is,
you should look up these terms in the C++ grammar (which is listed
in Stroustrup's book, in case you don't have access to the spec itself).
In short, a single declaration may contain multiple declarators:
char *a, b;
for example is a single declaration, with declarators '*a' and 'b'.
There are also cases where a declarator is not part of a declaration.
HTH,
Stefan
|