From ddae2516b8596647e9741affa0280cd6e6e41bdb Mon Sep 17 00:00:00 2001 From: Matthias Gehre Date: Tue, 4 Apr 2017 20:11:13 +0000 Subject: [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 --- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp') 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 struct a {};\n" + "struct a b() {\n" + "}\n" + "#define c inline\n" + "void d() {\n" + "}\n", + fixNamespaceEndComments("template struct a {};\n" + "struct a b() {\n" + "}\n" + "#define c inline\n" + "void d() {\n" + "}\n")); +} } // end namespace } // end namespace format } // end namespace clang -- cgit v1.2.3