forked from OSchip/llvm-project
clang-format: Don't merge simple blocks in case statements.
Before: switch (a) { case 1: { return 'a'; } } After: switch (a) { case 1: { return 'a'; } } llvm-svn: 205611
This commit is contained in:
parent
840beec2d0
commit
922349cdba
|
@ -623,7 +623,7 @@ private:
|
|||
AnnotatedLine &Line = **I;
|
||||
if (Line.First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_do, tok::r_brace,
|
||||
tok::kw_else, tok::kw_try, tok::kw_catch,
|
||||
tok::kw_for,
|
||||
tok::kw_for, tok::kw_case,
|
||||
// This gets rid of all ObjC @ keywords and methods.
|
||||
tok::at, tok::minus, tok::plus))
|
||||
return 0;
|
||||
|
|
|
@ -511,6 +511,9 @@ TEST_F(FormatTest, FormatsSwitchStatement) {
|
|||
" f();\n"
|
||||
" break;\n"
|
||||
"}\n"
|
||||
"case 2: {\n"
|
||||
" break;\n"
|
||||
"}\n"
|
||||
"}");
|
||||
verifyFormat("switch (x) {\n"
|
||||
"case 1: {\n"
|
||||
|
|
Loading…
Reference in New Issue