summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-10-30 05:07:56 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-10-30 05:07:56 +0000
commit328085f3250dcb86464b06017132edadd93c6b1b (patch)
tree24681f6affb5037de9fc49325b596287193a7ab5 /clang/unittests
parent49359bf3d7d3205cc7aa18b34685778f24d27104 (diff)
downloadbcm5719-llvm-328085f3250dcb86464b06017132edadd93c6b1b.tar.gz
bcm5719-llvm-328085f3250dcb86464b06017132edadd93c6b1b.zip
Format: support inline namespaces
Correct handling for C++17 inline namespaces. We would previously fail to identify the inline namespaces as a namespace name since multiple ones may be concatenated now with C++17. llvm-svn: 251690
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index eaa31b1ebfa..1c68d67956c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2192,6 +2192,13 @@ TEST_F(FormatTest, FormatsNamespaces) {
"} // my_namespace\n"
"#endif // HEADER_GUARD"));
+ EXPECT_EQ("namespace A::B {\n"
+ "class C {};\n"
+ "}",
+ format("namespace A::B {\n"
+ "class C {};\n"
+ "}"));
+
FormatStyle Style = getLLVMStyle();
Style.NamespaceIndentation = FormatStyle::NI_All;
EXPECT_EQ("namespace out {\n"
OpenPOWER on IntegriCloud