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:
Daniel Jasper 2014-04-04 06:46:23 +00:00
parent 840beec2d0
commit 922349cdba
2 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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"