@@ -1656,11 +1656,15 @@ class AnnotatingParser {
1656
1656
// Skip to l_paren.
1657
1657
for (LParen = CurrentToken->Next ;
1658
1658
LParen && LParen->isNot (tok::l_paren); LParen = LParen->Next ) {
1659
+ if (LParen->isPointerOrReference ())
1660
+ LParen->setFinalizedType (TT_PointerOrReference);
1659
1661
}
1660
1662
}
1661
1663
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
+ }
1664
1668
break ;
1665
1669
}
1666
1670
}
@@ -1683,7 +1687,8 @@ class AnnotatingParser {
1683
1687
if (CurrentToken->is (tok::comma) && Previous->isNot (tok::kw_operator))
1684
1688
break ;
1685
1689
if (Previous->isOneOf (TT_BinaryOperator, TT_UnaryOperator, tok::comma,
1686
- tok::star, tok::arrow, tok::amp, tok::ampamp) ||
1690
+ tok::arrow) ||
1691
+ Previous->isPointerOrReference () ||
1687
1692
// User defined literal.
1688
1693
Previous->TokenText .starts_with (" \"\" " )) {
1689
1694
Previous->setType (TT_OverloadedOperator);
@@ -3026,7 +3031,7 @@ class AnnotatingParser {
3026
3031
3027
3032
if (!NextToken ||
3028
3033
NextToken->isOneOf (tok::arrow, tok::equal, tok::comma, tok::r_paren,
3029
- TT_RequiresClause, TT_FunctionDeclarationLParen ) ||
3034
+ TT_RequiresClause) ||
3030
3035
(NextToken->is (tok::kw_noexcept) && !IsExpression) ||
3031
3036
NextToken->canBePointerOrReferenceQualifier () ||
3032
3037
(NextToken->is (tok::l_brace) && !NextToken->getNextNonComment ())) {
0 commit comments