diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-10-30 05:07:56 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-10-30 05:07:56 +0000 |
commit | 328085f3250dcb86464b06017132edadd93c6b1b (patch) | |
tree | 24681f6affb5037de9fc49325b596287193a7ab5 /clang/unittests | |
parent | 49359bf3d7d3205cc7aa18b34685778f24d27104 (diff) | |
download | bcm5719-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.cpp | 7 |
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" |