Still the formatting can be improved, but at least we don't assert any
more. This happened when trying to format lib/Sema/SemaType.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175003
91177308-0d34-0410-b5e6-
96231b3b80d8
}
void UnwrappedLineParser::parseLabel() {
- // FIXME: remove all asserts.
- assert(FormatTok.Tok.is(tok::colon) && "':' expected");
+ if (FormatTok.Tok.isNot(tok::colon))
+ return;
nextToken();
unsigned OldLineLevel = Line->Level;
if (Line->Level > 0)
"}");
verifyFormat("switch (test)\n"
" ;");
+
+ // FIXME: Improve formatting of case labels in macros.
+ verifyFormat("#define SOMECASES \\\n"
+ "case 1: \\\n"
+ " case 2\n", getLLVMStyleWithColumns(20));
+
verifyGoogleFormat("switch (x) {\n"
" case 1:\n"
" f();\n"