tok::kw_new, tok::kw_delete) &&
(!Left.Previous || Left.Previous->isNot(tok::period))))) ||
(Style.SpaceBeforeParens == FormatStyle::SBPO_Always &&
- (Left.is(tok::identifier) || Left.isFunctionLikeKeyword()) &&
+ (Left.is(tok::identifier) || Left.isFunctionLikeKeyword() || Left.is(tok::r_paren)) &&
Line.Type != LT_PreprocessorDirective);
}
if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword)
verifyFormat("size_t x = alignof(MyType);", NoSpace);
verifyFormat("static_assert(sizeof(char) == 1, \"Impossible!\");", NoSpace);
verifyFormat("int f() throw(Deprecated);", NoSpace);
+ verifyFormat("typedef void (*cb)(int);", NoSpace);
FormatStyle Space = getLLVMStyle();
Space.SpaceBeforeParens = FormatStyle::SBPO_Always;
verifyFormat("size_t x = alignof (MyType);", Space);
verifyFormat("static_assert (sizeof (char) == 1, \"Impossible!\");", Space);
verifyFormat("int f () throw (Deprecated);", Space);
+ verifyFormat("typedef void (*cb) (int);", Space);
}
TEST_F(FormatTest, ConfigurableSpacesInParentheses) {