Commit bbdb7d97 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed parsing ambiguity when parsing dependant template types.

parent 0af4d51b
......@@ -1568,10 +1568,26 @@ bool Parser::parseTemplateTypeParameter(DeclarationAST *&node)
return false;
}
bool Parser::lookAtTypeParameter() const
{
if ((LA() == T_CLASS || LA() == T_TYPENAME) && LA(2) == T_IDENTIFIER) {
switch (LA(3)) {
case T_EQUAL:
case T_COMMA:
case T_GREATER:
return true;
}
}
return false;
}
bool Parser::parseTypeParameter(DeclarationAST *&node)
{
DEBUG_THIS_RULE();
if (LA() == T_CLASS || LA() == T_TYPENAME)
if (lookAtTypeParameter())
return parseTypenameTypeParameter(node);
else if (LA() == T_TEMPLATE)
return parseTemplateTypeParameter(node);
......
......@@ -280,6 +280,7 @@ public:
bool skipUntilStatement();
bool skip(int l, int r);
bool lookAtTypeParameter() const;
bool lookAtCVQualifier() const;
bool lookAtFunctionSpecifier() const;
bool lookAtStorageClassSpecifier() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment