aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-10 09:26:47 +0000
committerDaniel Jasper <djasper@google.com>2013-01-10 09:26:47 +0000
commit700e710544a50ec63f984b9b098530bf9107920a (patch)
treec6bd533a7e87f689117115d2fc09e43f8c3c5afc /unittests/Format/FormatTest.cpp
parentf20318f9e27a064bdd9a3fbb51d2c3a4a4f3ac2e (diff)
Do more error checking for '{}'.
This fixes llvm.org/PR14883, where clang-format would run into an assertion on: void f() { return } 42 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 389c58c428..739bcdd80f 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1036,6 +1036,10 @@ TEST_F(FormatTest, HandlesIncludeDirectives) {
// Error recovery tests.
//===----------------------------------------------------------------------===//
+TEST_F(FormatTest, IncorrectCodeTrailingStuff) {
+ verifyFormat("void f() { return } 42");
+}
+
TEST_F(FormatTest, IndentationWithinColumnLimitNotPossible) {
verifyFormat("int aaaaaaaa =\n"
" // Overly long comment\n"