clang-format: Fix crasher on incomplete condition compilation.
Previously crashing input:
void f(
#if A
);
#else
#endif
llvm-svn: 226451
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 548273a..f267c94 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2930,6 +2930,12 @@
"#if a\n"
"#else\n"
"#endif");
+
+ verifyFormat("void f(\n"
+ "#if A\n"
+ " );\n"
+ "#else\n"
+ "#endif");
}
TEST_F(FormatTest, GraciouslyHandleIncorrectPreprocessorConditions) {