C++: Fix variable template parsing in expression

Fix parser to not fail on TemplateId without parentheses, for example:
int i = foo<int> + foo<char>;

This fixes std::pair structure parsing in MSVC headers and find Usages
to work with pair->first and pair->second.

Change-Id: Ic300ea99d44a749705430d5eb47b2744715af995
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Volodymyr Zibarov
2020-05-29 14:57:45 +03:00
parent 1291eb975b
commit 3ad203b56e
3 changed files with 58 additions and 6 deletions

View File

@@ -5066,12 +5066,6 @@ bool Parser::parseNameId(NameAST *&name)
case T_CONST_CAST:
rewind(start);
return parseName(name, false);
default:
if (tok().isLiteral() || tok().isPunctuationOrOperator()) {
rewind(start);
return parseName(name, false);
}
} // switch
return true;