From 91b032ab5528ca64333497b0dd666a0dc1bf9b32 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 22 May 2014 12:46:38 +0000 Subject: clang-format: Fix braced list detection. Before: static_assert(std::is_integral {} + 0, ""); int a = std::is_integral {} + 0; After: static_assert(std::is_integral{} + 0, ""); int a = std::is_integral{} + 0; llvm-svn: 209431 --- clang/unittests/Format/FormatTest.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index f9016f4bf1a..729eeaf4399 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -5262,6 +5262,8 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { " T member = {arg1, arg2};\n" "};"); verifyFormat("vector foo = {::SomeGlobalFunction()};"); + verifyFormat("static_assert(std::is_integral{} + 0, \"\");"); + verifyFormat("int a = std::is_integral{} + 0;"); verifyFormat("int foo(int i) { return fo1{}(i); }"); verifyFormat("int foo(int i) { return fo1{}(i); }"); @@ -6088,10 +6090,14 @@ TEST_F(FormatTest, FormatObjCImplementation) { "@implementation Bar\n" "@end"); - verifyFormat("@implementation Foo : Bar\n" - "+ (id)init {\n}\n" - "- (void)foo {\n}\n" - "@end"); + EXPECT_EQ("@implementation Foo : Bar\n" + "+ (id)init {\n}\n" + "- (void)foo {\n}\n" + "@end", + format("@implementation Foo : Bar\n" + "+(id)init{}\n" + "-(void)foo{}\n" + "@end")); verifyFormat("@implementation Foo {\n" " int _i;\n" -- cgit v1.2.3