clang-format: Fix segfault in 'incomplete' macros.
The code leading to a segfault was:
#pragma omp threadprivate(y)), // long comment leading to a line break
This fixes llvm.org/PR16513.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189460 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index d80011b..067a259 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1942,6 +1942,9 @@
verifyFormat("#define A template <typename T>");
verifyFormat("#define STR(x) #x\n"
"f(STR(this_is_a_string_literal{));");
+ verifyFormat("#pragma omp threadprivate( \\\n"
+ " y)), // expected-warning",
+ getLLVMStyleWithColumns(28));
}
TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) {