if (Right.Type == TT_UnaryOperator)
return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
(Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
- if ((Left.isOneOf(tok::identifier, tok::greater, tok::r_square) ||
+ if ((Left.isOneOf(tok::identifier, tok::greater, tok::r_square,
+ tok::r_paren) ||
Left.isSimpleTypeSpecifier()) &&
Right.is(tok::l_brace) && Right.getNextNonComment() &&
Right.BlockKind != BK_Block)
verifyFormat("STATIC_ASSERT((a & b) == 0);");
verifyFormat("STATIC_ASSERT(0 == (a & b));");
verifyFormat("template <bool a, bool b> "
- "typename t::if<x && y>::type f() {};");
- verifyFormat("template <int *y> f() {};");
+ "typename t::if<x && y>::type f() {}");
+ verifyFormat("template <int *y> f() {}");
verifyFormat("vector<int *> v;");
verifyFormat("vector<int *const> v;");
verifyFormat("vector<int *const **const *> v;");
}
TEST_F(FormatTest, LayoutBraceInitializersInReturnStatement) {
- verifyFormat("return (a)(b) {1, 2, 3};");
+ verifyFormat("return (a)(b){1, 2, 3};");
}
TEST_F(FormatTest, LayoutCxx11BraceInitializers) {
verifyFormat("int foo(int i) { return fo1{}(i); }");
verifyFormat("int foo(int i) { return fo1{}(i); }");
+ verifyFormat("auto i = decltype(x){};");
// In combination with BinPackParameters = false.
FormatStyle NoBinPacking = getLLVMStyle();
verifyFormat("void f() {\n"
" return g() {}\n"
" void h() {}");
- verifyFormat("int a[] = {void forgot_closing_brace() {f();\n"
+ verifyFormat("int a[] = {void forgot_closing_brace(){f();\n"
"g();\n"
"}");
}