summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-11-10 17:11:18 +0000
committerDaniel Jasper <djasper@google.com>2017-11-10 17:11:18 +0000
commit028d815e2847d7056b37eb938b5fdaca7aa3636e (patch)
tree20f0f06173ad9f4cc338ca9f594afe256f440c30 /clang/unittests/Format/UsingDeclarationsSorterTest.cpp
parentc77d00e327d4997c5bb34e39ee6e16ca339237ca (diff)
downloadbcm5719-llvm-028d815e2847d7056b37eb938b5fdaca7aa3636e.tar.gz
bcm5719-llvm-028d815e2847d7056b37eb938b5fdaca7aa3636e.zip
[clang-format] Handle leading comments in using declaration
This fixes clang-format internal assertion for the following code: /* override */ using std::string; Patch by Igor Sugak. Thank you. llvm-svn: 317901
Diffstat (limited to 'clang/unittests/Format/UsingDeclarationsSorterTest.cpp')
-rw-r--r--clang/unittests/Format/UsingDeclarationsSorterTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/UsingDeclarationsSorterTest.cpp b/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
index e72076a8e31..37427a51f82 100644
--- a/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
+++ b/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
@@ -348,6 +348,13 @@ TEST_F(UsingDeclarationsSorterTest, SortsPartialRangeOfUsingDeclarations) {
{tooling::Range(19, 1)}));
}
+TEST_F(UsingDeclarationsSorterTest, SortsUsingDeclarationsWithLeadingkComments) {
+ EXPECT_EQ("/* comment */ using a;\n"
+ "/* comment */ using b;",
+ sortUsingDeclarations("/* comment */ using b;\n"
+ "/* comment */ using a;"));
+}
+
} // end namespace
} // end namespace format
} // end namespace clang
OpenPOWER on IntegriCloud