Fix clang-format segfault.
When annotating "lines" starting with ":", clang-format would segfault.
This could actually happen in valid code, e.g.
#define A :
llvm-svn: 177283
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 4ac9bce..e6ae81d 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1068,6 +1068,8 @@
}
TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) {
+ verifyFormat("#define A :");
+
// FIXME: Improve formatting of case labels in macros.
verifyFormat("#define SOMECASES \\\n"
"case 1: \\\n"