@@ -3595,6 +3595,13 @@ static bool isFunctionDeclarationName(const FormatToken &Current,
3595
3595
if (!Current.Tok .getIdentifierInfo ())
3596
3596
return false ;
3597
3597
3598
+ const auto &Previous = *Current.Previous ;
3599
+
3600
+ if (const auto *PrevPrev = Previous.Previous ;
3601
+ PrevPrev && PrevPrev->is (TT_ObjCDecl)) {
3602
+ return false ;
3603
+ }
3604
+
3598
3605
auto skipOperatorName = [](const FormatToken *Next) -> const FormatToken * {
3599
3606
for (; Next; Next = Next->Next ) {
3600
3607
if (Next->is (TT_OverloadedOperatorLParen))
@@ -3633,18 +3640,17 @@ static bool isFunctionDeclarationName(const FormatToken &Current,
3633
3640
// Find parentheses of parameter list.
3634
3641
const FormatToken *Next = Current.Next ;
3635
3642
if (Current.is (tok::kw_operator)) {
3636
- const auto *Previous = Current.Previous ;
3637
- if (Previous->Tok .getIdentifierInfo () &&
3638
- !Previous->isOneOf (tok::kw_return, tok::kw_co_return)) {
3643
+ if (Previous.Tok .getIdentifierInfo () &&
3644
+ !Previous.isOneOf (tok::kw_return, tok::kw_co_return)) {
3639
3645
return true ;
3640
3646
}
3641
- if (Previous-> is (tok::r_paren) && Previous-> is (TT_TypeDeclarationParen)) {
3642
- assert (Previous-> MatchingParen );
3643
- assert (Previous-> MatchingParen ->is (tok::l_paren));
3644
- assert (Previous-> MatchingParen ->is (TT_TypeDeclarationParen));
3647
+ if (Previous. is (tok::r_paren) && Previous. is (TT_TypeDeclarationParen)) {
3648
+ assert (Previous. MatchingParen );
3649
+ assert (Previous. MatchingParen ->is (tok::l_paren));
3650
+ assert (Previous. MatchingParen ->is (TT_TypeDeclarationParen));
3645
3651
return true ;
3646
3652
}
3647
- if (!Previous-> isPointerOrReference () && Previous-> isNot (TT_TemplateCloser))
3653
+ if (!Previous. isPointerOrReference () && Previous. isNot (TT_TemplateCloser))
3648
3654
return false ;
3649
3655
Next = skipOperatorName (Next);
3650
3656
} else {
0 commit comments