From 09080ab89af611a1557551a7b4e0c6c8c1dfca17 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 14 Feb 2014 22:12:54 +0000 Subject: [PATCH] Consistently print anonymous namespace names as "" For some reason we have two bits of code handling this printing: lib/AST/Decl.cpp: OS << ""; lib/AST/TypePrinter.cpp: OS << "::"; it would be nice if we only had one... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201437 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Modules/namespaces.cpp | 4 ++-- test/SemaCXX/undefined-internal.cpp | 4 ++-- unittests/ASTMatchers/ASTMatchersTest.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp index 8c225e051b..003c7d36b8 100644 --- a/test/Modules/namespaces.cpp +++ b/test/Modules/namespaces.cpp @@ -69,8 +69,8 @@ void testMergedMerged() { // Test merging when using anonymous namespaces, which does not // actually perform any merging. void testAnonymousNotMerged() { - N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'N11::::Foo *' with an rvalue of type 'N11::::Foo *'}} - N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::::Foo *' with an rvalue of type 'N12::::Foo *'}} + N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'N11::::Foo *' with an rvalue of type 'N11::::Foo *'}} + N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::::Foo *' with an rvalue of type 'N12::::Foo *'}} } // expected-note@Inputs/namespaces-right.h:60 {{passing argument to parameter here}} diff --git a/test/SemaCXX/undefined-internal.cpp b/test/SemaCXX/undefined-internal.cpp index 9d3048dc2e..67ad110fb3 100644 --- a/test/SemaCXX/undefined-internal.cpp +++ b/test/SemaCXX/undefined-internal.cpp @@ -78,8 +78,8 @@ namespace test5 { } template struct B { - static int var; // expected-warning {{variable 'test5::B::A>::var' has internal linkage but is not defined}} - static void foo(); // expected-warning {{function 'test5::B::A>::foo' has internal linkage but is not defined}} + static int var; // expected-warning {{variable 'test5::B::A>::var' has internal linkage but is not defined}} + static void foo(); // expected-warning {{function 'test5::B::A>::foo' has internal linkage but is not defined}} }; void test() { diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 5c9753f933..669978b8a9 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -1038,7 +1038,7 @@ TEST(HasType, MatchesAsString) { EXPECT_TRUE(matches("namespace ns { struct A {}; } struct B { ns::A a; };", fieldDecl(hasType(asString("ns::A"))))); EXPECT_TRUE(matches("namespace { struct A {}; } struct B { A a; };", - fieldDecl(hasType(asString("struct ::A"))))); + fieldDecl(hasType(asString("struct ::A"))))); } TEST(Matcher, OverloadedOperatorCall) { -- 2.40.0