diff options
author | Daniel Jasper <djasper@google.com> | 2013-03-18 12:50:26 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-03-18 12:50:26 +0000 |
commit | cf6d76af806f7e1ba97be7b72b31bc78b919e0f0 (patch) | |
tree | 172dbf476793ffd92656ff07ffee9a625c7efe0b /unittests/Format/FormatTest.cpp | |
parent | 74c8b794be93e73ffca42b1dcf70f26c92d9ccfd (diff) |
Fix clang-format segfault.
When annotating "lines" starting with ":", clang-format would segfault.
This could actually happen in valid code, e.g.
#define A :
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 4ac9bce56b..e6ae81da5c 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1068,6 +1068,8 @@ TEST_F(FormatTest, EmptyLinesInMacroDefinitions) { } TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) { + verifyFormat("#define A :"); + // FIXME: Improve formatting of case labels in macros. verifyFormat("#define SOMECASES \\\n" "case 1: \\\n" |