@@ -803,13 +803,6 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
803
803
return !Tok.Previous ->isOneOf (TT_CastRParen, tok::kw_for, tok::kw_while,
804
804
tok::kw_switch);
805
805
};
806
- // Detecting functions is brittle. It would be better if we could annotate
807
- // the LParen type of functions/calls.
808
- auto IsFunctionDeclParen = [&](const FormatToken &Tok) {
809
- return Tok.is (tok::l_paren) && Tok.Previous &&
810
- (Tok.Previous ->is (TT_FunctionDeclarationName) ||
811
- Tok.endsSequence (TT_FunctionDeclarationName, tok::coloncolon));
812
- };
813
806
auto IsLambdaParameterList = [](const FormatToken *Tok) {
814
807
// adapted from TokenAnnotator.cpp:isLambdaParameterList()
815
808
// Skip <...> if present.
@@ -846,10 +839,11 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
846
839
if (Tok.FakeLParens .size () > 0 && Tok.FakeLParens .back () > prec::Unknown)
847
840
return true ;
848
841
if (Previous &&
849
- (IsFunctionDeclParen (* Previous) || IsFunctionCallParen (*Previous ) ||
850
- IsLambdaParameterList (Previous))) {
842
+ (Previous-> is (TT_FunctionDeclarationLParen ) ||
843
+ IsFunctionCallParen (*Previous) || IsLambdaParameterList (Previous))) {
851
844
return !IsOpeningBracket (Tok) && Next && !Next->isMemberAccess () &&
852
- !IsInTemplateString (Tok) && !IsFunctionDeclParen (*Next) &&
845
+ !IsInTemplateString (Tok) &&
846
+ !Next->is (TT_FunctionDeclarationLParen) &&
853
847
!IsFunctionCallParen (*Next);
854
848
}
855
849
return false ;
0 commit comments