clang-format: Prevent ObjC code from confusing the braced-init detection
This was leading to bad formatting, e.g.: Before: f(^{ @autoreleasepool { if (a) { g(); } } }); After: f(^{ @autoreleasepool { if (a) { g(); } } }); llvm-svn: 203777
This commit is contained in:
parent
e8bd672d31
commit
ac7e34e778
|
@ -357,6 +357,7 @@ void UnwrappedLineParser::calculateBraceTypes() {
|
||||||
LBraceStack.pop_back();
|
LBraceStack.pop_back();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case tok::at:
|
||||||
case tok::semi:
|
case tok::semi:
|
||||||
case tok::kw_if:
|
case tok::kw_if:
|
||||||
case tok::kw_while:
|
case tok::kw_while:
|
||||||
|
|
|
@ -8062,6 +8062,14 @@ TEST_F(FormatTest, FormatsBlocks) {
|
||||||
" // ...\n"
|
" // ...\n"
|
||||||
" int i;\n"
|
" int i;\n"
|
||||||
" }];");
|
" }];");
|
||||||
|
|
||||||
|
verifyFormat("f(^{\n"
|
||||||
|
" @autoreleasepool {\n"
|
||||||
|
" if (a) {\n"
|
||||||
|
" g();\n"
|
||||||
|
" }\n"
|
||||||
|
" }\n"
|
||||||
|
"});");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(FormatTest, SupportsCRLF) {
|
TEST_F(FormatTest, SupportsCRLF) {
|
||||||
|
|
Loading…
Reference in New Issue