From 8972f4e96650c0fed11cec168562a1a8de8418ac Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 14 Feb 2014 22:12:54 +0000 Subject: 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... llvm-svn: 201437 --- clang/test/Modules/namespaces.cpp | 4 ++-- clang/test/SemaCXX/undefined-internal.cpp | 4 ++-- clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'clang') diff --git a/clang/test/Modules/namespaces.cpp b/clang/test/Modules/namespaces.cpp index 8c225e051bd..003c7d36b8d 100644 --- a/clang/test/Modules/namespaces.cpp +++ b/clang/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/clang/test/SemaCXX/undefined-internal.cpp b/clang/test/SemaCXX/undefined-internal.cpp index 9d3048dc2e2..67ad110fb34 100644 --- a/clang/test/SemaCXX/undefined-internal.cpp +++ b/clang/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/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 5c9753f9336..669978b8a9f 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/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) { -- cgit v1.2.1