@@ -803,20 +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
- auto IsLambdaParameterList = [](const FormatToken *Tok) {
807
- // adapted from TokenAnnotator.cpp:isLambdaParameterList()
808
- // Skip <...> if present.
809
- if (Tok->Previous && Tok->Previous ->is (tok::greater) &&
810
- Tok->Previous ->MatchingParen &&
811
- Tok->Previous ->MatchingParen ->is (TT_TemplateOpener)) {
812
- Tok = Tok->Previous ->MatchingParen ;
813
- }
814
-
815
- // Check for `[...]`.
816
- return Tok->Previous && Tok->Previous ->is (tok::r_square) &&
817
- Tok->Previous ->MatchingParen &&
818
- Tok->Previous ->MatchingParen ->is (TT_LambdaLSquare);
819
- };
820
806
auto IsFunctionCallParen = [&](const FormatToken &Tok) {
821
807
return Tok.is (tok::l_paren) && Tok.ParameterCount > 0 && Tok.Previous &&
822
808
Tok.Previous ->is (tok::identifier);
@@ -838,9 +824,9 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
838
824
const auto *Next = Tok.Next ;
839
825
if (Tok.FakeLParens .size () > 0 && Tok.FakeLParens .back () > prec::Unknown)
840
826
return true ;
841
- if (Previous &&
842
- ( Previous-> is (TT_FunctionDeclarationLParen ) ||
843
- IsFunctionCallParen (*Previous) || IsLambdaParameterList ( Previous))) {
827
+ if (Previous && (Previous-> is (TT_FunctionDeclarationLParen) ||
828
+ IsFunctionCallParen (* Previous) ||
829
+ Previous-> is (TT_LambdaDefinitionLParen ))) {
844
830
return !IsOpeningBracket (Tok) && Next && !Next->isMemberAccess () &&
845
831
!IsInTemplateString (Tok) &&
846
832
!Next->is (TT_FunctionDeclarationLParen) &&
0 commit comments