From 328085f3250dcb86464b06017132edadd93c6b1b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 30 Oct 2015 05:07:56 +0000 Subject: 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 --- clang/unittests/Format/FormatTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/unittests') 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" -- cgit v1.2.1