(!Left.Previous || Left.Previous->isNot(tok::period))))) ||
(Style.SpaceBeforeParens == FormatStyle::SBPO_Always &&
(Left.is(tok::identifier) || Left.isFunctionLikeKeyword() ||
- Left.is(tok::r_paren)) &&
+ Left.is(tok::r_paren) ||
+ (Left.is(tok::r_square) && Left.MatchingParen &&
+ Left.MatchingParen->is(TT_LambdaLSquare))) &&
Line.Type != LT_PreprocessorDirective);
}
if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword)
verifyFormat("typedef void (*cb)(int);", NoSpace);
verifyFormat("T A::operator()();", NoSpace);
verifyFormat("X A::operator++(T);", NoSpace);
+ verifyFormat("auto lambda = []() { return 0; };", NoSpace);
FormatStyle Space = getLLVMStyle();
Space.SpaceBeforeParens = FormatStyle::SBPO_Always;
verifyFormat("typedef void (*cb) (int);", Space);
verifyFormat("T A::operator() ();", Space);
verifyFormat("X A::operator++ (T);", Space);
+ verifyFormat("auto lambda = [] () { return 0; };", Space);
}
TEST_F(FormatTest, ConfigurableSpacesInParentheses) {