diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-06-19 12:39:11 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-06-19 12:39:32 +0200 |
commit | 20545fd4b187d47d93f5229a292fb232e4d57936 (patch) | |
tree | a45a6a29b9038bc90b9af915fdde2747b929c7fc /src/shared/cplusplus/Parser.cpp | |
parent | 3545c822c959fa2151e7f5c1d446b10afb489a20 (diff) | |
download | qt-creator-20545fd4b187d47d93f5229a292fb232e4d57936.tar.gz |
Fixed more template-id vs expressions ambiguites.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index e987d4d2fc..e46f4bbae9 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2927,7 +2927,8 @@ bool Parser::parseNameId(NameAST *&name) TemplateIdAST *template_id = name->asTemplateId(); if (LA() == T_LPAREN && template_id) { if (TemplateArgumentListAST *template_arguments = template_id->template_arguments) { - if (! template_arguments->next && template_arguments->template_argument && template_arguments->template_argument->asBinaryExpression()) { + if (! template_arguments->next && template_arguments->template_argument && + template_arguments->template_argument->asBinaryExpression()) { unsigned saved = cursor(); ExpressionAST *expr = 0; bool blocked = blockErrors(true); @@ -2949,13 +2950,16 @@ bool Parser::parseNameId(NameAST *&name) } } - if (LA() == T_IDENTIFIER || + if (LA() == T_COMMA || LA() == T_SEMICOLON || + LA() == T_LBRACKET || LA() == T_LPAREN) + return true; + else if (LA() == T_IDENTIFIER || LA() == T_STATIC_CAST || LA() == T_DYNAMIC_CAST || LA() == T_REINTERPRET_CAST || LA() == T_CONST_CAST || tok().isLiteral() || - (tok().isOperator() && LA() != T_LPAREN && LA() != T_LBRACKET)) + tok().isOperator()) { rewind(start); return parseName(name, false); |