summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-02 05:58:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-02 05:58:29 +0000
commit11e1a3a385febc1f603b1717510c00be7c37882a (patch)
tree8660969c8a44e3d3d36f1cdbf8896fa1e87082c5
parent8ef7942d6e4dc0894a52333b261172df3564a1a6 (diff)
downloadclang-11e1a3a385febc1f603b1717510c00be7c37882a.tar.gz
clang-11e1a3a385febc1f603b1717510c00be7c37882a.tar.bz2
clang-11e1a3a385febc1f603b1717510c00be7c37882a.tar.xz
Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda at ... )')
For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205398 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/PrettyPrinter.h2
-rw-r--r--lib/AST/Decl.cpp6
-rw-r--r--lib/AST/TemplateBase.cpp4
-rw-r--r--lib/AST/TypePrinter.cpp10
-rw-r--r--lib/Parse/ParseDeclCXX.cpp2
-rw-r--r--lib/Sema/SemaTemplate.cpp4
-rw-r--r--test/Analysis/cfg.cpp2
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p19.cpp2
-rw-r--r--test/CodeGenCXX/destructors.cpp6
-rw-r--r--test/CodeGenCXX/microsoft-abi-structors.cpp4
-rw-r--r--test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp20
-rw-r--r--test/CodeGenCXX/predefined-expr.cpp10
-rw-r--r--test/Layout/ms-x86-alias-avoidance-padding.cpp8
-rw-r--r--test/Modules/namespaces.cpp4
-rw-r--r--test/OpenMP/threadprivate_messages.cpp4
-rw-r--r--test/Parser/cxx0x-lambda-expressions.cpp2
-rw-r--r--test/Sema/switch.c32
-rw-r--r--test/SemaCXX/ms-interface.cpp2
-rw-r--r--test/SemaCXX/undefined-internal.cpp46
-rw-r--r--test/SemaCXX/warn-shadow.cpp2
-rw-r--r--test/SemaCXX/warn-sign-conversion.cpp34
-rw-r--r--unittests/ASTMatchers/ASTMatchersTest.cpp2
22 files changed, 104 insertions, 104 deletions
diff --git a/include/clang/AST/PrettyPrinter.h b/include/clang/AST/PrettyPrinter.h
index 8f89379d4a..349f4c44a4 100644
--- a/include/clang/AST/PrettyPrinter.h
+++ b/include/clang/AST/PrettyPrinter.h
@@ -126,7 +126,7 @@ struct PrintingPolicy {
/// \brief When printing an anonymous tag name, also print the location of
/// that entity (e.g., "enum <anonymous at t.h:10:5>"). Otherwise, just
- /// prints "<anonymous>" for the name.
+ /// prints "(anonymous)" for the name.
bool AnonymousTagLocations : 1;
/// \brief When true, suppress printing of the __strong lifetime qualifier in
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index c2e1a848c1..83cbb44f7f 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1303,12 +1303,12 @@ void NamedDecl::printQualifiedName(raw_ostream &OS,
P);
} else if (const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(*I)) {
if (ND->isAnonymousNamespace())
- OS << "<anonymous namespace>";
+ OS << "(anonymous namespace)";
else
OS << *ND;
} else if (const RecordDecl *RD = dyn_cast<RecordDecl>(*I)) {
if (!RD->getIdentifier())
- OS << "<anonymous " << RD->getKindName() << '>';
+ OS << "(anonymous " << RD->getKindName() << ')';
else
OS << *RD;
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*I)) {
@@ -1341,7 +1341,7 @@ void NamedDecl::printQualifiedName(raw_ostream &OS,
if (getDeclName())
OS << *this;
else
- OS << "<anonymous>";
+ OS << "(anonymous)";
}
void NamedDecl::getNameForDiagnostic(raw_ostream &OS,
diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp
index b068ffafef..52f95bf25a 100644
--- a/lib/AST/TemplateBase.cpp
+++ b/lib/AST/TemplateBase.cpp
@@ -345,7 +345,7 @@ void TemplateArgument::print(const PrintingPolicy &Policy,
raw_ostream &Out) const {
switch (getKind()) {
case Null:
- Out << "<no value>";
+ Out << "(no value)";
break;
case Type: {
@@ -362,7 +362,7 @@ void TemplateArgument::print(const PrintingPolicy &Policy,
// FIXME: distinguish between pointer and reference args?
ND->printQualifiedName(Out);
} else {
- Out << "<anonymous>";
+ Out << "(anonymous)";
}
break;
}
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp
index 8f18f4c6c2..89ec8d6bbc 100644
--- a/lib/AST/TypePrinter.cpp
+++ b/lib/AST/TypePrinter.cpp
@@ -848,7 +848,7 @@ void TypePrinter::AppendScope(DeclContext *DC, raw_ostream &OS) {
if (NS->getIdentifier())
OS << NS->getName() << "::";
else
- OS << "<anonymous namespace>::";
+ OS << "(anonymous namespace)::";
} else if (ClassTemplateSpecializationDecl *Spec
= dyn_cast<ClassTemplateSpecializationDecl>(DC)) {
IncludeStrongLifetimeRAII Strong(Policy);
@@ -900,13 +900,13 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) {
OS << Typedef->getIdentifier()->getName();
} else {
// Make an unambiguous representation for anonymous types, e.g.
- // <anonymous enum at /usr/include/string.h:120:9>
+ // (anonymous enum at /usr/include/string.h:120:9)
if (isa<CXXRecordDecl>(D) && cast<CXXRecordDecl>(D)->isLambda()) {
- OS << "<lambda";
+ OS << "(lambda";
HasKindDecoration = true;
} else {
- OS << "<anonymous";
+ OS << "(anonymous";
}
if (Policy.AnonymousTagLocations) {
@@ -925,7 +925,7 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) {
}
}
- OS << '>';
+ OS << ')';
}
// If this is a class template specialization, print the template
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index c84bdcbf35..cef748f2aa 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -2517,7 +2517,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
<< /*ErrorType=*/6
<< (isa<NamedDecl>(TagDecl)
? cast<NamedDecl>(TagDecl)->getQualifiedNameAsString()
- : "<anonymous>");
+ : "(anonymous)");
}
break;
}
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 2b88bf9bf0..9be7189ba9 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2515,7 +2515,7 @@ DeclResult Sema::ActOnVarTemplateSpecialization(
<< Param->getDeclName();
else
Diag(Param->getLocation(), diag::note_partial_spec_unused_parameter)
- << "<anonymous>";
+ << "(anonymous)";
}
}
}
@@ -6115,7 +6115,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
else
Diag(Param->getLocation(),
diag::note_partial_spec_unused_parameter)
- << "<anonymous>";
+ << "(anonymous)";
}
}
}
diff --git a/test/Analysis/cfg.cpp b/test/Analysis/cfg.cpp
index 1f3bfac2c3..65060b1687 100644
--- a/test/Analysis/cfg.cpp
+++ b/test/Analysis/cfg.cpp
@@ -51,7 +51,7 @@ void checkWrap(int i) {
// CHECK-NEXT: CXXConstructExpr
// CHECK-NEXT: 9: struct standalone myStandalone;
// CHECK-NEXT: CXXConstructExpr
-// CHECK-NEXT: 11: struct <anonymous struct at {{.*}}> myAnon;
+// CHECK-NEXT: 11: struct (anonymous struct at {{.*}}) myAnon;
// CHECK-NEXT: CXXConstructExpr
// CHECK-NEXT: 13: struct named myNamed;
// CHECK-NEXT: Preds (1): B2
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p19.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p19.cpp
index 8a6e79273d..35b77896c8 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p19.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p19.cpp
@@ -10,7 +10,7 @@ void test_special_member_functions(MoveOnly mo, int i) {
auto lambda1 = [i]() { }; // expected-note 2 {{lambda expression begins here}}
// Default constructor
- decltype(lambda1) lambda2; // expected-error{{call to implicitly-deleted default constructor of 'decltype(lambda1)' (aka '<lambda}}
+ decltype(lambda1) lambda2; // expected-error{{call to implicitly-deleted default constructor of 'decltype(lambda1)' (aka '(lambda}}
// Copy assignment operator
lambda1 = lambda1; // expected-error{{copy assignment operator is implicitly deleted}}
diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp
index 9bd2754b91..5c430480bc 100644
--- a/test/CodeGenCXX/destructors.cpp
+++ b/test/CodeGenCXX/destructors.cpp
@@ -381,7 +381,7 @@ namespace test10 {
// Checks from test3:
- // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::<anonymous namespace>::D"* %this) unnamed_addr
+ // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::(anonymous namespace)::D"* %this) unnamed_addr
// CHECK: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
// CHECK: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
// CHECK: ret void
@@ -405,7 +405,7 @@ namespace test10 {
// CHECK: call void @_ZN5test312_GLOBAL__N_11CD2Ev(
// CHECK: ret void
- // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::<anonymous namespace>::C"* %this) unnamed_addr
+ // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
// CHECK: invoke void @_ZN5test31BD2Ev(
// CHECK: call void @_ZN5test31AD2Ev(
// CHECK: ret void
@@ -413,7 +413,7 @@ namespace test10 {
// CHECK: declare void @_ZN5test31BD2Ev(
// CHECK: declare void @_ZN5test31AD2Ev(
- // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::<anonymous namespace>::C"* %this) unnamed_addr
+ // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
// CHECK: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
// CHECK: call void @_ZdlPv({{.*}}) [[NUW]]
// CHECK: ret void
diff --git a/test/CodeGenCXX/microsoft-abi-structors.cpp b/test/CodeGenCXX/microsoft-abi-structors.cpp
index 85b9a7df63..b79da8d6cb 100644
--- a/test/CodeGenCXX/microsoft-abi-structors.cpp
+++ b/test/CodeGenCXX/microsoft-abi-structors.cpp
@@ -417,6 +417,6 @@ void *getA() {
return (void*)new A();
}
// CHECK: define internal x86_thiscallcc void @"\01??_GA@?A@@UAEPAXI@Z"
-// CHECK: (%"struct.<anonymous namespace>::A"* %this, i32 %should_call_delete)
+// CHECK: (%"struct.(anonymous namespace)::A"* %this, i32 %should_call_delete)
// CHECK: define internal x86_thiscallcc void @"\01??1A@?A@@UAE@XZ"
-// CHECK: (%"struct.<anonymous namespace>::A"* %this)
+// CHECK: (%"struct.(anonymous namespace)::A"* %this)
diff --git a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
index 879e1d9cfd..1546e6ce56 100644
--- a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
+++ b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
@@ -35,14 +35,14 @@ void f() {
// CHECK32: store i8* bitcast (void (%struct.C*)* @"\01??_9C@@$BA@AE" to i8*), i8** %ptr
// CHECK32: store i8* bitcast (i32 (%struct.C*, i32, double)* @"\01??_9C@@$B3AE" to i8*), i8** %ptr2
// CHECK32: store i8* bitcast (void (%struct.S*, %struct.C*, i32)* @"\01??_9C@@$B7AE" to i8*), i8** %ptr3
-// CHECK32: store i8* bitcast (void (%"struct.<anonymous namespace>::D"*)* @"\01??_9D@?A@@$BA@AE" to i8*), i8** %ptr4
+// CHECK32: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*)* @"\01??_9D@?A@@$BA@AE" to i8*), i8** %ptr4
// CHECK32: }
//
// CHECK64-LABEL: define void @"\01?f@@YAXXZ"()
// CHECK64: store i8* bitcast (void (%struct.C*)* @"\01??_9C@@$BA@AA" to i8*), i8** %ptr
// CHECK64: store i8* bitcast (i32 (%struct.C*, i32, double)* @"\01??_9C@@$B7AA" to i8*), i8** %ptr2
// CHECK64: store i8* bitcast (void (%struct.S*, %struct.C*, i32)* @"\01??_9C@@$BBA@AA" to i8*), i8** %ptr3
-// CHECK64: store i8* bitcast (void (%"struct.<anonymous namespace>::D"*)* @"\01??_9D@?A@@$BA@AA" to i8*), i8** %ptr
+// CHECK64: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*)* @"\01??_9D@?A@@$BA@AA" to i8*), i8** %ptr
// CHECK64: }
}
@@ -93,16 +93,16 @@ void f() {
// CHECK64: }
// Thunk for calling the virtual function in internal class D.
-// CHECK32-LABEL: define internal x86_thiscallcc void @"\01??_9D@?A@@$BA@AE"(%"struct.<anonymous namespace>::D"* %this) unnamed_addr
-// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.<anonymous namespace>::D"*)** %{{.*}}, i64 0
-// CHECK32: [[CALLEE:%.*]] = load void (%"struct.<anonymous namespace>::D"*)** [[VPTR]]
-// CHECK32: call x86_thiscallcc void [[CALLEE]](%"struct.<anonymous namespace>::D"* %{{.*}})
+// CHECK32-LABEL: define internal x86_thiscallcc void @"\01??_9D@?A@@$BA@AE"(%"struct.(anonymous namespace)::D"* %this) unnamed_addr
+// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.(anonymous namespace)::D"*)** %{{.*}}, i64 0
+// CHECK32: [[CALLEE:%.*]] = load void (%"struct.(anonymous namespace)::D"*)** [[VPTR]]
+// CHECK32: call x86_thiscallcc void [[CALLEE]](%"struct.(anonymous namespace)::D"* %{{.*}})
// CHECK32: ret void
// CHECK32: }
//
-// CHECK64-LABEL: define internal void @"\01??_9D@?A@@$BA@AA"(%"struct.<anonymous namespace>::D"* %this) unnamed_addr
-// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.<anonymous namespace>::D"*)** %{{.*}}, i64 0
-// CHECK64: [[CALLEE:%.*]] = load void (%"struct.<anonymous namespace>::D"*)** [[VPTR]]
-// CHECK64: call void [[CALLEE]](%"struct.<anonymous namespace>::D"* %{{.*}})
+// CHECK64-LABEL: define internal void @"\01??_9D@?A@@$BA@AA"(%"struct.(anonymous namespace)::D"* %this) unnamed_addr
+// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.(anonymous namespace)::D"*)** %{{.*}}, i64 0
+// CHECK64: [[CALLEE:%.*]] = load void (%"struct.(anonymous namespace)::D"*)** [[VPTR]]
+// CHECK64: call void [[CALLEE]](%"struct.(anonymous namespace)::D"* %{{.*}})
// CHECK64: ret void
// CHECK64: }
diff --git a/test/CodeGenCXX/predefined-expr.cpp b/test/CodeGenCXX/predefined-expr.cpp
index b2b1ba3030..f901467c4f 100644
--- a/test/CodeGenCXX/predefined-expr.cpp
+++ b/test/CodeGenCXX/predefined-expr.cpp
@@ -10,7 +10,7 @@
// CHECK: private unnamed_addr constant [122 x i8] c"static void ClassWithTemplateTemplateParam<char, NS::ClassTemplate>::staticMember() [T = char, Param = NS::ClassTemplate]\00"
// CHECK: private unnamed_addr constant [106 x i8] c"void OuterClass<int *>::MiddleClass::InnerClass<float>::memberFunction(T, U) const [T = int *, U = float]\00"
// CHECK: private unnamed_addr constant [51 x i8] c"void functionTemplateWithCapturedStmt(T) [T = int]\00"
-// CHECK: private unnamed_addr constant [76 x i8] c"auto functionTemplateWithLambda(int)::<anonymous class>::operator()() const\00"
+// CHECK: private unnamed_addr constant [76 x i8] c"auto functionTemplateWithLambda(int)::(anonymous class)::operator()() const\00"
// CHECK: private unnamed_addr constant [65 x i8] c"void functionTemplateWithUnnamedTemplateParameter(T) [T = float]\00"
// CHECK: private unnamed_addr constant [60 x i8] c"void functionTemplateExplicitSpecialization(T) [T = double]\00"
@@ -28,13 +28,13 @@
// CHECK: private unnamed_addr constant [46 x i8] c"void NS::Base::functionTemplate1(T) [T = int]\00"
// CHECK: private unnamed_addr constant [23 x i8] c"anonymousUnionFunction\00"
-// CHECK: private unnamed_addr constant [83 x i8] c"void NS::ContainerForAnonymousRecords::<anonymous union>::anonymousUnionFunction()\00"
+// CHECK: private unnamed_addr constant [83 x i8] c"void NS::ContainerForAnonymousRecords::(anonymous union)::anonymousUnionFunction()\00"
// CHECK: private unnamed_addr constant [24 x i8] c"anonymousStructFunction\00"
-// CHECK: private unnamed_addr constant [85 x i8] c"void NS::ContainerForAnonymousRecords::<anonymous struct>::anonymousStructFunction()\00"
+// CHECK: private unnamed_addr constant [85 x i8] c"void NS::ContainerForAnonymousRecords::(anonymous struct)::anonymousStructFunction()\00"
// CHECK: private unnamed_addr constant [23 x i8] c"anonymousClassFunction\00"
-// CHECK: private unnamed_addr constant [83 x i8] c"void NS::ContainerForAnonymousRecords::<anonymous class>::anonymousClassFunction()\00"
+// CHECK: private unnamed_addr constant [83 x i8] c"void NS::ContainerForAnonymousRecords::(anonymous class)::anonymousClassFunction()\00"
// CHECK: private unnamed_addr constant [12 x i8] c"~Destructor\00"
// CHECK: private unnamed_addr constant [30 x i8] c"NS::Destructor::~Destructor()\00"
@@ -93,7 +93,7 @@
// CHECK: private unnamed_addr constant [59 x i8] c"void ClassInTopLevelNamespace::topLevelNamespaceFunction()\00"
// CHECK: private unnamed_addr constant [27 x i8] c"anonymousNamespaceFunction\00"
-// CHECK: private unnamed_addr constant [84 x i8] c"void <anonymous namespace>::ClassInAnonymousNamespace::anonymousNamespaceFunction()\00"
+// CHECK: private unnamed_addr constant [84 x i8] c"void (anonymous namespace)::ClassInAnonymousNamespace::anonymousNamespaceFunction()\00"
// CHECK: private unnamed_addr constant [19 x i8] c"localClassFunction\00"
// CHECK: private unnamed_addr constant [59 x i8] c"void NS::localClass(int)::LocalClass::localClassFunction()\00"
diff --git a/test/Layout/ms-x86-alias-avoidance-padding.cpp b/test/Layout/ms-x86-alias-avoidance-padding.cpp
index f95c78b6de..aac652135a 100644
--- a/test/Layout/ms-x86-alias-avoidance-padding.cpp
+++ b/test/Layout/ms-x86-alias-avoidance-padding.cpp
@@ -56,8 +56,8 @@ struct AT3 : AT2, AT1 {
// CHECK-NEXT: 0 | struct AT3
// CHECK-NEXT: 0 | struct AT2 (base)
// CHECK-NEXT: 0 | struct AT0 t
-// CHECK-NEXT: 0 | union AT0::<anonymous at {{.*}} x
-// CHECK-NEXT: 0 | struct AT0::<anonymous at {{.*}} y
+// CHECK-NEXT: 0 | union AT0::(anonymous at {{.*}} x
+// CHECK-NEXT: 0 | struct AT0::(anonymous at {{.*}} y
// CHECK-NEXT: 0 | int a
// CHECK-NEXT: 4 | struct AT t (empty)
// CHECK: 0 | int b
@@ -81,8 +81,8 @@ struct AT3 : AT2, AT1 {
// CHECK-X64-NEXT: 0 | struct AT3
// CHECK-X64-NEXT: 0 | struct AT2 (base)
// CHECK-X64-NEXT: 0 | struct AT0 t
-// CHECK-X64-NEXT: 0 | union AT0::<anonymous at {{.*}} x
-// CHECK-X64-NEXT: 0 | struct AT0::<anonymous at {{.*}} y
+// CHECK-X64-NEXT: 0 | union AT0::(anonymous at {{.*}} x
+// CHECK-X64-NEXT: 0 | struct AT0::(anonymous at {{.*}} y
// CHECK-X64-NEXT: 0 | int a
// CHECK-X64-NEXT: 4 | struct AT t (empty)
// CHECK-X64: 0 | int b
diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp
index c27c5f0613..a6f4c25cc0 100644
--- a/test/Modules/namespaces.cpp
+++ b/test/Modules/namespaces.cpp
@@ -72,8 +72,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::<anonymous namespace>::Foo *' with an rvalue of type 'N11::<anonymous namespace>::Foo *'}}
- N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::<anonymous namespace>::Foo *' with an rvalue of type 'N12::<anonymous namespace>::Foo *'}}
+ N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'N11::(anonymous namespace)::Foo *' with an rvalue of type 'N11::(anonymous namespace)::Foo *'}}
+ N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::(anonymous namespace)::Foo *' with an rvalue of type 'N12::(anonymous namespace)::Foo *'}}
}
// expected-note@Inputs/namespaces-right.h:60 {{passing argument to parameter here}}
diff --git a/test/OpenMP/threadprivate_messages.cpp b/test/OpenMP/threadprivate_messages.cpp
index 4e50c6f9d4..4b4f9e0146 100644
--- a/test/OpenMP/threadprivate_messages.cpp
+++ b/test/OpenMP/threadprivate_messages.cpp
@@ -99,9 +99,9 @@ static __thread int t; // expected-note {{'t' defined here}}
int o; // expected-note {{candidate found by name lookup is 'o'}}
#pragma omp threadprivate (o)
namespace {
-int o; // expected-note {{candidate found by name lookup is '<anonymous namespace>::o'}}
+int o; // expected-note {{candidate found by name lookup is '(anonymous namespace)::o'}}
#pragma omp threadprivate (o)
-#pragma omp threadprivate (o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable '<anonymous namespace>::o'}}
+#pragma omp threadprivate (o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable '(anonymous namespace)::o'}}
}
#pragma omp threadprivate (o) // expected-error {{reference to 'o' is ambiguous}}
#pragma omp threadprivate (::o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'o'}}
diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp
index 9ce24cbb04..53ea05ea86 100644
--- a/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/test/Parser/cxx0x-lambda-expressions.cpp
@@ -34,7 +34,7 @@ class C {
typedef int T;
const int b = 0;
const int c = 1;
- int a1[1] = {[b] (T()) {}}; // expected-error{{no viable conversion from '<lambda}}
+ int a1[1] = {[b] (T()) {}}; // expected-error{{no viable conversion from '(lambda}}
int a2[1] = {[b] = 1 };
int a3[1] = {[b,c] = 1 }; // expected-error{{expected body of lambda expression}}
int a4[1] = {[&b] = 1 }; // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'const int *'}}
diff --git a/test/Sema/switch.c b/test/Sema/switch.c
index a2f87b9d0a..092378d48b 100644
--- a/test/Sema/switch.c
+++ b/test/Sema/switch.c
@@ -109,14 +109,14 @@ void test7() {
switch(a) {
case A:
case B:
- case 3: // expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 3: // expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
switch(a) {
case A:
case B:
- case 3 ... //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
- 4: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 3 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
+ 4: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
switch(a) {
@@ -124,16 +124,16 @@ void test7() {
break;
}
switch(a) {
- case 0 ... 2: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 0 ... 2: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
switch(a) {
- case 1 ... 3: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 1 ... 3: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
switch(a) {
- case 0 ... //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
- 3: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 0 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
+ 3: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
@@ -167,11 +167,11 @@ void test9() {
C = 1
} a;
switch(a) {
- case 0: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 0: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
case 1:
- case 2: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 2: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
case 3:
- case 4: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 4: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
}
@@ -184,14 +184,14 @@ void test10() {
D = 12
} a;
switch(a) {
- case 0 ... //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
- 1: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 0 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
+ 1: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
case 2 ... 4:
- case 5 ... //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
- 9: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 5 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
+ 9: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
case 10 ... 12:
- case 13 ... //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
- 16: //expected-warning{{case value not in enumerated type 'enum <anonymous enum}}
+ case 13 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
+ 16: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}}
break;
}
}
diff --git a/test/SemaCXX/ms-interface.cpp b/test/SemaCXX/ms-interface.cpp
index 3625f7027a..e7386ce5b8 100644
--- a/test/SemaCXX/ms-interface.cpp
+++ b/test/SemaCXX/ms-interface.cpp
@@ -10,7 +10,7 @@ __interface I1 {
bool operator!();
// expected-error@+1 {{operator 'operator int' is not permitted within an interface type}}
operator int();
- // expected-error@+1 {{nested class I1::<anonymous> is not permitted within an interface type}}
+ // expected-error@+1 {{nested class I1::(anonymous) is not permitted within an interface type}}
struct { int a; };
void fn2() {
struct A { }; // should be ignored: not a nested class
diff --git a/test/SemaCXX/undefined-internal.cpp b/test/SemaCXX/undefined-internal.cpp
index 67ad110fb3..1cb0708a53 100644
--- a/test/SemaCXX/undefined-internal.cpp
+++ b/test/SemaCXX/undefined-internal.cpp
@@ -18,9 +18,9 @@ namespace test1 {
namespace test2 {
namespace {
- void foo(); // expected-warning {{function 'test2::<anonymous namespace>::foo' has internal linkage but is not defined}}
- extern int var; // expected-warning {{variable 'test2::<anonymous namespace>::var' has internal linkage but is not defined}}
- template <class T> void bar(); // expected-warning {{function 'test2::<anonymous namespace>::bar<int>' has internal linkage but is not defined}}
+ void foo(); // expected-warning {{function 'test2::(anonymous namespace)::foo' has internal linkage but is not defined}}
+ extern int var; // expected-warning {{variable 'test2::(anonymous namespace)::var' has internal linkage but is not defined}}
+ template <class T> void bar(); // expected-warning {{function 'test2::(anonymous namespace)::bar<int>' has internal linkage but is not defined}}
}
void test() {
foo(); // expected-note {{used here}}
@@ -52,11 +52,11 @@ namespace test3 {
namespace test4 {
namespace {
struct A {
- A(); // expected-warning {{function 'test4::<anonymous namespace>::A::A' has internal linkage but is not defined}}
- ~A();// expected-warning {{function 'test4::<anonymous namespace>::A::~A' has internal linkage but is not defined}}
- virtual void foo(); // expected-warning {{function 'test4::<anonymous namespace>::A::foo' has internal linkage but is not defined}}
+ A(); // expected-warning {{function 'test4::(anonymous namespace)::A::A' has internal linkage but is not defined}}
+ ~A();// expected-warning {{function 'test4::(anonymous namespace)::A::~A' has internal linkage but is not defined}}
+ virtual void foo(); // expected-warning {{function 'test4::(anonymous namespace)::A::foo' has internal linkage but is not defined}}
virtual void bar() = 0;
- virtual void baz(); // expected-warning {{function 'test4::<anonymous namespace>::A::baz' has internal linkage but is not defined}}
+ virtual void baz(); // expected-warning {{function 'test4::(anonymous namespace)::A::baz' has internal linkage but is not defined}}
};
}
@@ -78,8 +78,8 @@ namespace test5 {
}
template <class N> struct B {
- static int var; // expected-warning {{variable 'test5::B<test5::<anonymous namespace>::A>::var' has internal linkage but is not defined}}
- static void foo(); // expected-warning {{function 'test5::B<test5::<anonymous namespace>::A>::foo' has internal linkage but is not defined}}
+ static int var; // expected-warning {{variable 'test5::B<test5::(anonymous namespace)::A>::var' has internal linkage but is not defined}}
+ static void foo(); // expected-warning {{function 'test5::B<test5::(anonymous namespace)::A>::foo' has internal linkage but is not defined}}
};
void test() {
@@ -178,7 +178,7 @@ namespace cxx11_odr_rules {
namespace OverloadUse {
namespace {
void f();
- void f(int); // expected-warning {{function 'OverloadUse::<anonymous namespace>::f' has internal linkage but is not defined}}
+ void f(int); // expected-warning {{function 'OverloadUse::(anonymous namespace)::f' has internal linkage but is not defined}}
}
template<void x()> void t(int*) { x(); }
template<void x(int)> void t(long*) { x(10); } // expected-note {{used here}}
@@ -196,7 +196,7 @@ namespace test7 {
namespace test8 {
typedef struct {
- void bar(); // expected-warning {{function 'test8::<anonymous struct>::bar' has internal linkage but is not defined}}
+ void bar(); // expected-warning {{function 'test8::(anonymous struct)::bar' has internal linkage but is not defined}}
void foo() {
bar(); // expected-note {{used here}}
}
@@ -207,7 +207,7 @@ namespace test9 {
namespace {
struct X {
virtual void notused() = 0;
- virtual void used() = 0; // expected-warning {{function 'test9::<anonymous namespace>::X::used' has internal linkage but is not defined}}
+ virtual void used() = 0; // expected-warning {{function 'test9::(anonymous namespace)::X::used' has internal linkage but is not defined}}
};
}
void test(X &x) {
@@ -220,7 +220,7 @@ namespace test10 {
namespace {
struct X {
virtual void notused() = 0;
- virtual void used() = 0; // expected-warning {{function 'test10::<anonymous namespace>::X::used' has internal linkage but is not defined}}
+ virtual void used() = 0; // expected-warning {{function 'test10::(anonymous namespace)::X::used' has internal linkage but is not defined}}
void test() {
notused();
@@ -247,11 +247,11 @@ namespace test11 {
};
struct B {
- bool operator()() const; // expected-warning {{function 'test11::<anonymous namespace>::B::operator()' has internal linkage but is not defined}}
- void operator!() const; // expected-warning {{function 'test11::<anonymous namespace>::B::operator!' has internal linkage but is not defined}}
- bool operator+(const B&) const; // expected-warning {{function 'test11::<anonymous namespace>::B::operator+' has internal linkage but is not defined}}
- int operator[](int) const; // expected-warning {{function 'test11::<anonymous namespace>::B::operator[]' has internal linkage but is not defined}}
- const B* operator->() const; // expected-warning {{function 'test11::<anonymous namespace>::B::operator->' has internal linkage but is not defined}}
+ bool operator()() const; // expected-warning {{function 'test11::(anonymous namespace)::B::operator()' has internal linkage but is not defined}}
+ void operator!() const; // expected-warning {{function 'test11::(anonymous namespace)::B::operator!' has internal linkage but is not defined}}
+ bool operator+(const B&) const; // expected-warning {{function 'test11::(anonymous namespace)::B::operator+' has internal linkage but is not defined}}
+ int operator[](int) const; // expected-warning {{function 'test11::(anonymous namespace)::B::operator[]' has internal linkage but is not defined}}
+ const B* operator->() const; // expected-warning {{function 'test11::(anonymous namespace)::B::operator->' has internal linkage but is not defined}}
int member;
};
}
@@ -281,18 +281,18 @@ namespace test12 {
struct Cls {
virtual void f(int) = 0;
virtual void f(int, double) = 0;
- void g(int); // expected-warning {{function 'test12::<anonymous namespace>::Cls::g' has internal linkage but is not defined}}
+ void g(int); // expected-warning {{function 'test12::(anonymous namespace)::Cls::g' has internal linkage but is not defined}}
void g(int, double);
virtual operator T1() = 0;
virtual operator T2() = 0;
virtual operator T3&() = 0;
- operator T4(); // expected-warning {{function 'test12::<anonymous namespace>::Cls::operator T4' has internal linkage but is not defined}}
- operator T5(); // expected-warning {{function 'test12::<anonymous namespace>::Cls::operator T5' has internal linkage but is not defined}}
- operator T6&(); // expected-warning {{function 'test12::<anonymous namespace>::Cls::operator test12::T6 &' has internal linkage but is not defined}}
+ operator T4(); // expected-warning {{function 'test12::(anonymous namespace)::Cls::operator T4' has internal linkage but is not defined}}
+ operator T5(); // expected-warning {{function 'test12::(anonymous namespace)::Cls::operator T5' has internal linkage but is not defined}}
+ operator T6&(); // expected-warning {{function 'test12::(anonymous namespace)::Cls::operator test12::T6 &' has internal linkage but is not defined}}
};
struct Cls2 {
- Cls2(T7); // expected-warning {{function 'test12::<anonymous namespace>::Cls2::Cls2' has internal linkage but is not defined}}
+ Cls2(T7); // expected-warning {{function 'test12::(anonymous namespace)::Cls2::Cls2' has internal linkage but is not defined}}
};
}
diff --git a/test/SemaCXX/warn-shadow.cpp b/test/SemaCXX/warn-shadow.cpp
index 68e9467a93..5ad2233d23 100644
--- a/test/SemaCXX/warn-shadow.cpp
+++ b/test/SemaCXX/warn-shadow.cpp
@@ -22,7 +22,7 @@ using namespace xx;
using namespace yy;
void foo() {
- int i; // expected-warning {{declaration shadows a variable in namespace '<anonymous>'}}
+ int i; // expected-warning {{declaration shadows a variable in namespace '(anonymous)'}}
int j; // expected-warning {{declaration shadows a variable in namespace 'one::two'}}
int m;
}
diff --git a/test/SemaCXX/warn-sign-conversion.cpp b/test/SemaCXX/warn-sign-conversion.cpp
index ba2bc9b3d0..746b1242fe 100644
--- a/test/SemaCXX/warn-sign-conversion.cpp
+++ b/test/SemaCXX/warn-sign-conversion.cpp
@@ -25,23 +25,23 @@ namespace test1 {
int c1 = 1 ? i : Foo<bool>::C;
int c2 = 1 ? Foo<bool>::C : i;
- int d1a = 1 ? i : Foo<bool>::D; // expected-warning {{test1::Foo<bool>::<anonymous enum at }}
- int d1b = 1 ? i : Foo<bool>::D; // expected-warning {{warn-sign-conversion.cpp:13:5>' to 'int'}}
- int d2a = 1 ? Foo<bool>::D : i; // expected-warning {{operand of ? changes signedness: 'test1::Foo<bool>::<anonymous enum at }}
- int d2b = 1 ? Foo<bool>::D : i; // expected-warning {{warn-sign-conversion.cpp:13:5>' to 'int'}}
- int d3a = 1 ? B : Foo<bool>::D; // expected-warning {{operand of ? changes signedness: 'test1::Foo<bool>::<anonymous enum at }}
- int d3b = 1 ? B : Foo<bool>::D; // expected-warning {{warn-sign-conversion.cpp:13:5>' to 'int'}}
- int d4a = 1 ? Foo<bool>::D : B; // expected-warning {{operand of ? changes signedness: 'test1::Foo<bool>::<anonymous enum at }}
- int d4b = 1 ? Foo<bool>::D : B; // expected-warning {{warn-sign-conversion.cpp:13:5>' to 'int'}}
-
- int e1a = 1 ? i : E; // expected-warning {{operand of ? changes signedness: 'test1::<anonymous enum at }}
- int e1b = 1 ? i : E; // expected-warning {{warn-sign-conversion.cpp:16:3>' to 'int'}}
- int e2a = 1 ? E : i; // expected-warning {{operand of ? changes signedness: 'test1::<anonymous enum at }}
- int e2b = 1 ? E : i; // expected-warning {{warn-sign-conversion.cpp:16:3>' to 'int'}}
- int e3a = 1 ? E : B; // expected-warning {{operand of ? changes signedness: 'test1::<anonymous enum at }}
- int e3b = 1 ? E : B; // expected-warning {{warn-sign-conversion.cpp:16:3>' to 'int'}}
- int e4a = 1 ? B : E; // expected-warning {{operand of ? changes signedness: 'test1::<anonymous enum at }}
- int e4b = 1 ? B : E; // expected-warning {{warn-sign-conversion.cpp:16:3>' to 'int'}}
+ int d1a = 1 ? i : Foo<bool>::D; // expected-warning {{test1::Foo<bool>::(anonymous enum at }}
+ int d1b = 1 ? i : Foo<bool>::D; // expected-warning {{warn-sign-conversion.cpp:13:5)' to 'int'}}
+ int d2a = 1 ? Foo<bool>::D : i; // expected-warning {{operand of ? changes signedness: 'test1::Foo<bool>::(anonymous enum at }}
+ int d2b = 1 ? Foo<bool>::D : i; // expected-warning {{warn-sign-conversion.cpp:13:5)' to 'int'}}
+ int d3a = 1 ? B : Foo<bool>::D; // expected-warning {{operand of ? changes signedness: 'test1::Foo<bool>::(anonymous enum at }}
+ int d3b = 1 ? B : Foo<bool>::D; // expected-warning {{warn-sign-conversion.cpp:13:5)' to 'int'}}
+ int d4a = 1 ? Foo<bool>::D : B; // expected-warning {{operand of ? changes signedness: 'test1::Foo<bool>::(anonymous enum at }}
+ int d4b = 1 ? Foo<bool>::D : B; // expected-warning {{warn-sign-conversion.cpp:13:5)' to 'int'}}
+
+ int e1a = 1 ? i : E; // expected-warning {{operand of ? changes signedness: 'test1::(anonymous enum at }}
+ int e1b = 1 ? i : E; // expected-warning {{warn-sign-conversion.cpp:16:3)' to 'int'}}
+ int e2a = 1 ? E : i; // expected-warning {{operand of ? changes signedness: 'test1::(anonymous enum at }}
+ int e2b = 1 ? E : i; // expected-warning {{warn-sign-conversion.cpp:16:3)' to 'int'}}
+ int e3a = 1 ? E : B; // expected-warning {{operand of ? changes signedness: 'test1::(anonymous enum at }}
+ int e3b = 1 ? E : B; // expected-warning {{warn-sign-conversion.cpp:16:3)' to 'int'}}
+ int e4a = 1 ? B : E; // expected-warning {{operand of ? changes signedness: 'test1::(anonymous enum at }}
+ int e4b = 1 ? B : E; // expected-warning {{warn-sign-conversion.cpp:16:3)' to 'int'}}
}
}
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp
index 6082c2b90a..05b07c81a9 100644
--- a/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -1041,7 +1041,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 <anonymous namespace>::A")))));
+ fieldDecl(hasType(asString("struct (anonymous namespace)::A")))));
}
TEST(Matcher, OverloadedOperatorCall) {