@@ -1656,11 +1656,15 @@ class AnnotatingParser {
16561656 // Skip to l_paren.
16571657 for (LParen = CurrentToken->Next ;
16581658 LParen && LParen->isNot (tok::l_paren); LParen = LParen->Next ) {
1659+ if (LParen->isPointerOrReference ())
1660+ LParen->setFinalizedType (TT_PointerOrReference);
16591661 }
16601662 }
16611663 if (LParen && LParen->is (tok::l_paren)) {
1662- Tok->setFinalizedType (TT_FunctionDeclarationName);
1663- LParen->setFinalizedType (TT_FunctionDeclarationLParen);
1664+ if (!Contexts.back ().IsExpression ) {
1665+ Tok->setFinalizedType (TT_FunctionDeclarationName);
1666+ LParen->setFinalizedType (TT_FunctionDeclarationLParen);
1667+ }
16641668 break ;
16651669 }
16661670 }
@@ -1683,7 +1687,8 @@ class AnnotatingParser {
16831687 if (CurrentToken->is (tok::comma) && Previous->isNot (tok::kw_operator))
16841688 break ;
16851689 if (Previous->isOneOf (TT_BinaryOperator, TT_UnaryOperator, tok::comma,
1686- tok::star, tok::arrow, tok::amp, tok::ampamp) ||
1690+ tok::arrow) ||
1691+ Previous->isPointerOrReference () ||
16871692 // User defined literal.
16881693 Previous->TokenText .starts_with (" \"\" " )) {
16891694 Previous->setType (TT_OverloadedOperator);
@@ -3026,7 +3031,7 @@ class AnnotatingParser {
30263031
30273032 if (!NextToken ||
30283033 NextToken->isOneOf (tok::arrow, tok::equal, tok::comma, tok::r_paren,
3029- TT_RequiresClause, TT_FunctionDeclarationLParen ) ||
3034+ TT_RequiresClause) ||
30303035 (NextToken->is (tok::kw_noexcept) && !IsExpression) ||
30313036 NextToken->canBePointerOrReferenceQualifier () ||
30323037 (NextToken->is (tok::l_brace) && !NextToken->getNextNonComment ())) {
0 commit comments