Before:
switch (x) {
default : {}
}
After:
switch (x) {
default: {}
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176861
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Tok.Type == TT_OverloadedOperatorLParen)
return false;
if (Tok.is(tok::colon))
- return Line.First.isNot(tok::kw_case) && !Tok.Children.empty() &&
+ return Line.First.isNot(tok::kw_case) &&
+ Line.First.isNot(tok::kw_default) && !Tok.Children.empty() &&
Tok.Type != TT_ObjCMethodExpr;
if (Tok.is(tok::l_paren) && !Tok.Children.empty() &&
Tok.Children[0].Type == TT_PointerOrReference &&
"}");
verifyFormat("switch (test)\n"
" ;");
+ verifyFormat("switch (x) {\n"
+ "default: {\n"
+ " // Do nothing.\n"
+ "}");
verifyGoogleFormat("switch (x) {\n"
" case 1:\n"