summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
diff options
context:
space:
mode:
authorMatthias Gehre <M.Gehre@gmx.de>2017-04-04 20:11:13 +0000
committerMatthias Gehre <M.Gehre@gmx.de>2017-04-04 20:11:13 +0000
commitddae2516b8596647e9741affa0280cd6e6e41bdb (patch)
tree80e34685a2c047b003d507c745aa78559a3485bc /clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
parent8465d083921c56ac35d2c292da316dd470641ef2 (diff)
downloadbcm5719-llvm-ddae2516b8596647e9741affa0280cd6e6e41bdb.tar.gz
bcm5719-llvm-ddae2516b8596647e9741affa0280cd6e6e41bdb.zip
[clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)
Summary: The new test case was crashing before. Now it passes as expected. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D31441 llvm-svn: 299465
Diffstat (limited to 'clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp')
-rw-r--r--clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
index 48ecdb038e9..912638f4565 100644
--- a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -582,6 +582,21 @@ TEST_F(NamespaceEndCommentsFixerTest,
"} // namespace\n"
"}"));
}
+
+TEST_F(NamespaceEndCommentsFixerTest, HandlesInlineAtEndOfLine_PR32438) {
+ EXPECT_EQ("template <int> struct a {};\n"
+ "struct a<bool{}> b() {\n"
+ "}\n"
+ "#define c inline\n"
+ "void d() {\n"
+ "}\n",
+ fixNamespaceEndComments("template <int> struct a {};\n"
+ "struct a<bool{}> b() {\n"
+ "}\n"
+ "#define c inline\n"
+ "void d() {\n"
+ "}\n"));
+}
} // end namespace
} // end namespace format
} // end namespace clang
OpenPOWER on IntegriCloud