]> granicus.if.org Git - clang/commitdiff
When pretty-printing tag types, only print the tag if we're in C (and
authorJohn McCall <rjmccall@apple.com>
Wed, 10 Mar 2010 11:27:22 +0000 (11:27 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 10 Mar 2010 11:27:22 +0000 (11:27 +0000)
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8

111 files changed:
include/clang/AST/PrettyPrinter.h
lib/AST/Expr.cpp
lib/AST/NestedNameSpecifier.cpp
lib/AST/TypePrinter.cpp
test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp
test/CXX/class.access/class.friend/p1.cpp
test/CXX/class/class.friend/p1.cpp
test/CXX/class/class.local/p2.cpp
test/CXX/class/class.union/p1.cpp
test/CXX/conv/conv.mem/p4.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
test/CXX/dcl.decl/dcl.init/p6.cpp
test/CXX/dcl.decl/dcl.meaning/dcl.mptr/p3.cpp
test/CodeCompletion/call.cpp
test/CodeCompletion/enum-switch-case-qualified.cpp
test/CodeCompletion/enum-switch-case.cpp
test/FixIt/typo.cpp
test/Index/code-completion.cpp
test/SemaCXX/access-base-class.cpp
test/SemaCXX/access-control-check.cpp
test/SemaCXX/aggregate-initialization.cpp
test/SemaCXX/ambig-user-defined-conversions.cpp
test/SemaCXX/arrow-operator.cpp
test/SemaCXX/attr-cxx0x.cpp
test/SemaCXX/builtin-ptrtomember-overload-1.cpp
test/SemaCXX/cast-conversion.cpp
test/SemaCXX/class-base-member-init.cpp
test/SemaCXX/conditional-expr.cpp
test/SemaCXX/const-cast.cpp
test/SemaCXX/constructor-initializer.cpp
test/SemaCXX/conversion-delete-expr.cpp
test/SemaCXX/conversion-function.cpp
test/SemaCXX/convert-to-bool.cpp
test/SemaCXX/copy-assignment.cpp
test/SemaCXX/copy-initialization.cpp
test/SemaCXX/cstyle-cast.cpp
test/SemaCXX/dcl_init_aggr.cpp
test/SemaCXX/decl-init-ref.cpp
test/SemaCXX/decltype-overloaded-functions.cpp
test/SemaCXX/default-assignment-operator.cpp
test/SemaCXX/default-constructor-initializers.cpp
test/SemaCXX/default2.cpp
test/SemaCXX/deleted-function.cpp
test/SemaCXX/derived-to-base-ambig.cpp
test/SemaCXX/destructor.cpp
test/SemaCXX/direct-initializer.cpp
test/SemaCXX/dynamic-cast.cpp
test/SemaCXX/elaborated-type-specifier.cpp
test/SemaCXX/exception-spec.cpp
test/SemaCXX/exceptions.cpp
test/SemaCXX/functional-cast.cpp
test/SemaCXX/illegal-member-initialization.cpp
test/SemaCXX/implicit-virtual-member-functions.cpp
test/SemaCXX/incomplete-call.cpp
test/SemaCXX/inherit.cpp
test/SemaCXX/member-name-lookup.cpp
test/SemaCXX/member-pointer.cpp
test/SemaCXX/missing-members.cpp
test/SemaCXX/nested-name-spec.cpp
test/SemaCXX/new-delete.cpp
test/SemaCXX/offsetof.cpp
test/SemaCXX/overload-member-call.cpp
test/SemaCXX/overloaded-operator.cpp
test/SemaCXX/qual-id-test.cpp
test/SemaCXX/qualified-id-lookup.cpp
test/SemaCXX/qualified-names-diag.cpp
test/SemaCXX/ref-init-ambiguous.cpp
test/SemaCXX/references.cpp
test/SemaCXX/reinterpret-cast.cpp
test/SemaCXX/rval-references.cpp
test/SemaCXX/static-assert.cpp
test/SemaCXX/static-cast-complete-type.cpp
test/SemaCXX/static-cast.cpp
test/SemaCXX/type-traits-incomplete.cpp
test/SemaCXX/typedef-redecl.cpp
test/SemaCXX/typeid.cpp
test/SemaCXX/unknown-type-name.cpp
test/SemaCXX/using-decl-templates.cpp
test/SemaCXX/value-initialization.cpp
test/SemaCXX/vararg-non-pod.cpp
test/SemaCXX/vector-casts.cpp
test/SemaCXX/virtual-member-functions-key-function.cpp
test/SemaCXX/virtual-override.cpp
test/SemaCXX/warn-reorder-ctor-initialization.cpp
test/SemaObjCXX/cstyle-cast.mm
test/SemaObjCXX/vararg-non-pod.mm
test/SemaTemplate/class-template-id-2.cpp
test/SemaTemplate/class-template-spec.cpp
test/SemaTemplate/default-expr-arguments.cpp
test/SemaTemplate/dependent-base-classes.cpp
test/SemaTemplate/ext-vector-type.cpp
test/SemaTemplate/instantiate-cast.cpp
test/SemaTemplate/instantiate-complete.cpp
test/SemaTemplate/instantiate-exception-spec.cpp
test/SemaTemplate/instantiate-expr-1.cpp
test/SemaTemplate/instantiate-expr-4.cpp
test/SemaTemplate/instantiate-field.cpp
test/SemaTemplate/instantiate-member-class.cpp
test/SemaTemplate/instantiate-member-expr.cpp
test/SemaTemplate/instantiate-method.cpp
test/SemaTemplate/instantiate-static-var.cpp
test/SemaTemplate/instantiate-typedef.cpp
test/SemaTemplate/instantiation-backtrace.cpp
test/SemaTemplate/instantiation-default-1.cpp
test/SemaTemplate/metafun-apply.cpp
test/SemaTemplate/temp_arg_nontype.cpp
test/SemaTemplate/temp_arg_type.cpp
test/SemaTemplate/typename-specifier.cpp

index 0635ec5dcd51e35b9d69676b2e09fe7f787575eb..587b5c2b40f7911c1e7a6c67d28e90ed578e6b86 100644 (file)
@@ -36,7 +36,7 @@ struct PrintingPolicy {
   /// \brief Create a default printing policy for C.
   PrintingPolicy(const LangOptions &LO)
     : Indentation(2), LangOpts(LO), SuppressSpecifiers(false),
-      SuppressTag(false), SuppressTagKind(false), SuppressScope(false),
+      SuppressTag(false), SuppressScope(false),
       Dump(false), ConstantArraySizeAsWritten(false) { }
 
   /// \brief The number of spaces to use to indent each line.
@@ -71,10 +71,6 @@ struct PrintingPolicy {
   /// \endcode
   bool SuppressTag : 1;
 
-  /// \brief If we are printing a tag type, suppresses printing of the
-  /// kind of tag, e.g., "struct", "union", "enum".
-  bool SuppressTagKind : 1;
-
   /// \brief Suppresses printing of scope specifiers.
   bool SuppressScope : 1;
 
@@ -101,6 +97,7 @@ struct PrintingPolicy {
   /// char a[9] = "A string";
   /// \endcode
   bool ConstantArraySizeAsWritten : 1;
+
 };
 
 } // end namespace clang
index c08a3a26e1782d31c2eab587503d69681f447e56..efd0fd1b8dcb9f073964cd66a75dc783ae1811a6 100644 (file)
@@ -181,7 +181,6 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) {
     }
 
     PrintingPolicy Policy(Context.getLangOptions());
-    Policy.SuppressTagKind = true;
 
     std::string Proto = FD->getQualifiedNameAsString(Policy);
 
index e26c0bba4934703c0a38b9cec223413cf119d256..45518e98bc152640f76d65a30e971d1107af186b 100644 (file)
@@ -142,7 +142,6 @@ NestedNameSpecifier::print(llvm::raw_ostream &OS,
     Type *T = getAsType();
 
     PrintingPolicy InnerPolicy(Policy);
-    InnerPolicy.SuppressTagKind = true;
     InnerPolicy.SuppressScope = true;
 
     // Nested-name-specifiers are intended to contain minimally-qualified
index 6e88ca32cab7e68d9859a63e904861a84a8f9aa7..037bc14e7a9199ce5dedb5993ea1a4b9324f9abd 100644 (file)
@@ -30,6 +30,7 @@ namespace {
     explicit TypePrinter(const PrintingPolicy &Policy) : Policy(Policy) { }
     
     void Print(QualType T, std::string &S);
+    void AppendScope(DeclContext *DC, std::string &S);
     void PrintTag(TagDecl *T, std::string &S);
 #define ABSTRACT_TYPE(CLASS, PARENT)
 #define TYPE(CLASS, PARENT) \
@@ -373,28 +374,71 @@ void TypePrinter::PrintDecltype(const DecltypeType *T, std::string &S) {
   S = "decltype(" + s.str() + ")" + S;
 }
 
+/// Appends the given scope to the end of a string.
+void TypePrinter::AppendScope(DeclContext *DC, std::string &Buffer) {
+  if (DC->isTranslationUnit()) return;
+  AppendScope(DC->getParent(), Buffer);
+
+  unsigned OldSize = Buffer.size();
+
+  if (NamespaceDecl *NS = dyn_cast<NamespaceDecl>(DC)) {
+    if (NS->getIdentifier())
+      Buffer += NS->getNameAsString();
+    else
+      Buffer += "<anonymous>";
+  } else if (ClassTemplateSpecializationDecl *Spec
+               = dyn_cast<ClassTemplateSpecializationDecl>(DC)) {
+    const TemplateArgumentList &TemplateArgs = Spec->getTemplateArgs();
+    std::string TemplateArgsStr
+      = TemplateSpecializationType::PrintTemplateArgumentList(
+                                            TemplateArgs.getFlatArgumentList(),
+                                            TemplateArgs.flat_size(),
+                                            Policy);
+    Buffer += Spec->getIdentifier()->getName();
+    Buffer += TemplateArgsStr;
+  } else if (TagDecl *Tag = dyn_cast<TagDecl>(DC)) {
+    if (TypedefDecl *Typedef = Tag->getTypedefForAnonDecl())
+      Buffer += Typedef->getIdentifier()->getName();
+    else if (Tag->getIdentifier())
+      Buffer += Tag->getIdentifier()->getName();
+  }
+
+  if (Buffer.size() != OldSize)
+    Buffer += "::";
+}
+
 void TypePrinter::PrintTag(TagDecl *D, std::string &InnerString) {
   if (Policy.SuppressTag)
     return;
-  
-  if (!InnerString.empty())    // Prefix the basic type, e.g. 'typedefname X'.
-    InnerString = ' ' + InnerString;
-  
-  const char *Kind = Policy.SuppressTagKind? 0 : D->getKindName();
+
+  std::string Buffer;
+
+  // We don't print tags unless this is an elaborated type.
+  // In C, we just assume every RecordType is an elaborated type.
+  if (!Policy.LangOpts.CPlusPlus && !D->getTypedefForAnonDecl()) {
+    Buffer += D->getKindName();
+    Buffer += ' ';
+  }
+
+  if (!Policy.SuppressScope)
+    // Compute the full nested-name-specifier for this type. In C,
+    // this will always be empty.
+    AppendScope(D->getDeclContext(), Buffer);
+
   const char *ID;
   if (const IdentifierInfo *II = D->getIdentifier())
     ID = II->getNameStart();
   else if (TypedefDecl *Typedef = D->getTypedefForAnonDecl()) {
-    Kind = 0;
     assert(Typedef->getIdentifier() && "Typedef without identifier?");
     ID = Typedef->getIdentifier()->getNameStart();
   } else
     ID = "<anonymous>";
-  
+  Buffer += ID;
+
   // If this is a class template specialization, print the template
   // arguments.
   if (ClassTemplateSpecializationDecl *Spec
-      = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
+        = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
     const TemplateArgument *Args;
     unsigned NumArgs;
     if (TypeSourceInfo *TAW = Spec->getTypeAsWritten()) {
@@ -407,48 +451,17 @@ void TypePrinter::PrintTag(TagDecl *D, std::string &InnerString) {
       Args = TemplateArgs.getFlatArgumentList();
       NumArgs = TemplateArgs.flat_size();
     }
-    std::string TemplateArgsStr
-      = TemplateSpecializationType::PrintTemplateArgumentList(Args, NumArgs,
-                                                              Policy);
-    InnerString = TemplateArgsStr + InnerString;
+    Buffer += TemplateSpecializationType::PrintTemplateArgumentList(Args,
+                                                                    NumArgs,
+                                                                    Policy);
   }
-  
-  if (!Policy.SuppressScope) {
-    // Compute the full nested-name-specifier for this type. In C,
-    // this will always be empty.
-    std::string ContextStr;
-    for (DeclContext *DC = D->getDeclContext();
-         !DC->isTranslationUnit(); DC = DC->getParent()) {
-      std::string MyPart;
-      if (NamespaceDecl *NS = dyn_cast<NamespaceDecl>(DC)) {
-        if (NS->getIdentifier())
-          MyPart = NS->getNameAsString();
-      } else if (ClassTemplateSpecializationDecl *Spec
-                  = dyn_cast<ClassTemplateSpecializationDecl>(DC)) {
-        const TemplateArgumentList &TemplateArgs = Spec->getTemplateArgs();
-        std::string TemplateArgsStr
-          = TemplateSpecializationType::PrintTemplateArgumentList(
-                                            TemplateArgs.getFlatArgumentList(),
-                                            TemplateArgs.flat_size(),
-                                            Policy);
-        MyPart = Spec->getIdentifier()->getName().str() + TemplateArgsStr;
-      } else if (TagDecl *Tag = dyn_cast<TagDecl>(DC)) {
-        if (TypedefDecl *Typedef = Tag->getTypedefForAnonDecl())
-          MyPart = Typedef->getIdentifier()->getName();
-        else if (Tag->getIdentifier())
-          MyPart = Tag->getIdentifier()->getName();
-      }
-      
-      if (!MyPart.empty())
-        ContextStr = MyPart + "::" + ContextStr;
-    }
-    
-    if (Kind)
-      InnerString = std::string(Kind) + ' ' + ContextStr + ID + InnerString;
-    else
-      InnerString = ContextStr + ID + InnerString;
-  } else
-    InnerString = ID + InnerString;  
+
+  if (!InnerString.empty()) {
+    Buffer += ' ';
+    Buffer += InnerString;
+  }
+
+  std::swap(Buffer, InnerString);
 }
 
 void TypePrinter::PrintRecord(const RecordType *T, std::string &S) {
@@ -460,11 +473,7 @@ void TypePrinter::PrintEnum(const EnumType *T, std::string &S) {
 }
 
 void TypePrinter::PrintElaborated(const ElaboratedType *T, std::string &S) { 
-  std::string TypeStr;
-  PrintingPolicy InnerPolicy(Policy);
-  InnerPolicy.SuppressTagKind = true;
-  TypePrinter(InnerPolicy).Print(T->getUnderlyingType(), S);
-  
+  Print(T->getUnderlyingType(), S);
   S = std::string(T->getNameForTagKind(T->getTagKind())) + ' ' + S;  
 }
 
@@ -507,8 +516,7 @@ void TypePrinter::PrintTemplateSpecialization(
 
 void TypePrinter::PrintInjectedClassName(const InjectedClassNameType *T,
                                          std::string &S) {
-  // TODO: this should probably be printed with template arguments
-  PrintTag(T->getDecl(), S);
+  PrintTemplateSpecialization(T->getUnderlyingTST(), S);
 }
 
 void TypePrinter::PrintQualifiedName(const QualifiedNameType *T, 
@@ -522,7 +530,6 @@ void TypePrinter::PrintQualifiedName(const QualifiedNameType *T,
   
   std::string TypeStr;
   PrintingPolicy InnerPolicy(Policy);
-  InnerPolicy.SuppressTagKind = true;
   InnerPolicy.SuppressScope = true;
   TypePrinter(InnerPolicy).Print(T->getNamedType(), TypeStr);
   
index 7a6210007eb932645c9f942597d06508d1ec3872..f9bac40c9ddbe43d8dd7d3333076573e9ad5e5dc 100644 (file)
@@ -57,9 +57,9 @@ void test3() {
 
   int i = Ints::zero;
   Numbers2::f(i);
-  Numbers2::g(i); // expected-error {{no viable conversion from 'int' to 'struct Numbers::Number' is possible}}
+  Numbers2::g(i); // expected-error {{no viable conversion from 'int' to 'Numbers::Number'}}
 
   float f = Floats::zero;
   Numbers2::f(f);
-  Numbers2::g(f); // expected-error {{no viable conversion from 'float' to 'struct Numbers::Number' is possible}}
+  Numbers2::g(f); // expected-error {{no viable conversion from 'float' to 'Numbers::Number'}}
 }
index 22f77b0955115adb89b2b32f5a17d6abdabe328d..a06fb2e3e3c2000fb388b4d050a98b795a8e58d9 100644 (file)
@@ -22,10 +22,10 @@ void test1() {
   S s;
   g()->f();
   S::f();
-  X::g(); // expected-error{{no member named 'g' in 'struct X'}}
-  X::S x_s; // expected-error{{no member named 'S' in 'struct X'}}
+  X::g(); // expected-error{{no member named 'g' in 'X'}}
+  X::S x_s; // expected-error{{no member named 'S' in 'X'}}
   X x;
-  x.g(); // expected-error{{no member named 'g' in 'struct X'}}
+  x.g(); // expected-error{{no member named 'g' in 'X'}}
 }
 
 // Test that we recurse through namespaces to find already declared names, but
@@ -46,17 +46,17 @@ namespace N {
     g()->f();
     S s;
     S::f();
-    X::g(); // expected-error{{no member named 'g' in 'struct N::X'}}
-    X::S x_s; // expected-error{{no member named 'S' in 'struct N::X'}}
+    X::g(); // expected-error{{no member named 'g' in 'N::X'}}
+    X::S x_s; // expected-error{{no member named 'S' in 'N::X'}}
     X x;
-    x.g(); // expected-error{{no member named 'g' in 'struct N::X'}}
+    x.g(); // expected-error{{no member named 'g' in 'N::X'}}
 
     g2();
     S2 s2;
     ::g2(); // expected-error{{no member named 'g2' in the global namespace}}
     ::S2 g_s2; // expected-error{{no member named 'S2' in the global namespace}}
-    X::g2(); // expected-error{{no member named 'g2' in 'struct N::X'}}
-    X::S2 x_s2; // expected-error{{no member named 'S2' in 'struct N::X'}}
-    x.g2(); // expected-error{{no member named 'g2' in 'struct N::X'}}
+    X::g2(); // expected-error{{no member named 'g2' in 'N::X'}}
+    X::S2 x_s2; // expected-error{{no member named 'S2' in 'N::X'}}
+    x.g2(); // expected-error{{no member named 'g2' in 'N::X'}}
   }
 }
index 886fef5bc4f62a2ff3f48ec70b13bb9cf71f19a7..3ad4a5f08289d0b7a6ab96f02ddfea9cda2f7fde 100644 (file)
@@ -67,7 +67,7 @@ class A {
   class facet {};
 };
 
-A::UndeclaredSoFar y; // expected-error {{no type named 'UndeclaredSoFar' in 'class A'}}
+A::UndeclaredSoFar y; // expected-error {{no type named 'UndeclaredSoFar' in 'A'}}
 
 class PreDeclared;
 
index 8d281a57e137dcc7c36b499f56761574374b6eca..2b1359c3d8d380ad2775cdac3e47b32d7cb53610 100644 (file)
@@ -7,5 +7,5 @@ void f() {
   
   B b;
   
-  A *a = &b; // expected-error{{cannot cast 'struct B' to its private base class 'struct A'}}
+  A *a = &b; // expected-error{{cannot cast 'B' to its private base class 'A'}}
 }
index 87946484ec18731502dce7dedaaa21b355394117..f53783eb5f3a387291221e3b3e6bbdece94ae63e 100644 (file)
@@ -7,30 +7,30 @@ class Okay {
 };
 
 class Virtual {
-  virtual void foo() { abort(); } // expected-note 3 {{because type 'class Virtual' has a virtual member function}}
+  virtual void foo() { abort(); } // expected-note 3 {{because type 'Virtual' has a virtual member function}}
 };
 
-class VirtualBase : virtual Okay { // expected-note 3 {{because type 'class VirtualBase' has a virtual base class}}
+class VirtualBase : virtual Okay { // expected-note 3 {{because type 'VirtualBase' has a virtual base class}}
 };
 
 class Ctor {
-  Ctor() { abort(); } // expected-note 3 {{because type 'class Ctor' has a user-declared constructor}}
+  Ctor() { abort(); } // expected-note 3 {{because type 'Ctor' has a user-declared constructor}}
 };
 class Ctor2 {
-  Ctor2(); // expected-note 3 {{because type 'class Ctor2' has a user-declared constructor}}
+  Ctor2(); // expected-note 3 {{because type 'Ctor2' has a user-declared constructor}}
 };
 
 class CopyCtor {
-  CopyCtor(CopyCtor &cc) { abort(); } // expected-note 3 {{because type 'class CopyCtor' has a user-declared copy constructor}}
+  CopyCtor(CopyCtor &cc) { abort(); } // expected-note 3 {{because type 'CopyCtor' has a user-declared copy constructor}}
 };
 
 // FIXME: this should eventually trigger on the operator's declaration line
-class CopyAssign { // expected-note 3 {{because type 'class CopyAssign' has a user-declared copy assignment operator}}
+class CopyAssign { // expected-note 3 {{because type 'CopyAssign' has a user-declared copy assignment operator}}
   CopyAssign& operator=(CopyAssign& CA) { abort(); }
 };
 
 class Dtor {
-  ~Dtor() { abort(); } // expected-note 3 {{because type 'class Dtor' has a user-declared destructor}}
+  ~Dtor() { abort(); } // expected-note 3 {{because type 'Dtor' has a user-declared destructor}}
 };
 
 union U1 {
@@ -46,25 +46,25 @@ union U1 {
 
 union U2 {
   struct {
-    Virtual v; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial copy constructor}}
+    Virtual v; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial copy constructor}}
   } m1; // expected-error {{union member 'm1' has a non-trivial copy constructor}}
   struct {
-    VirtualBase vbase; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial copy constructor}}
+    VirtualBase vbase; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial copy constructor}}
   } m2; // expected-error {{union member 'm2' has a non-trivial copy constructor}}
   struct {
-    Ctor ctor; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial constructor}}
+    Ctor ctor; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial constructor}}
   } m3; // expected-error {{union member 'm3' has a non-trivial constructor}}
   struct {
-    Ctor2 ctor2; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial constructor}}
+    Ctor2 ctor2; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial constructor}}
   } m3a; // expected-error {{union member 'm3a' has a non-trivial constructor}}
   struct {
-    CopyCtor copyctor; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial copy constructor}}
+    CopyCtor copyctor; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial copy constructor}}
   } m4; // expected-error {{union member 'm4' has a non-trivial copy constructor}}
   struct {
-    CopyAssign copyassign; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial copy assignment operator}}
+    CopyAssign copyassign; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial copy assignment operator}}
   } m5; // expected-error {{union member 'm5' has a non-trivial copy assignment operator}}
   struct {
-    Dtor dtor; // expected-note {{because type 'struct U2::<anonymous>' has a member with a non-trivial destructor}}
+    Dtor dtor; // expected-note {{because type 'U2::<anonymous>' has a member with a non-trivial destructor}}
   } m6; // expected-error {{union member 'm6' has a non-trivial destructor}}
   struct {
     Okay okay;
@@ -72,19 +72,19 @@ union U2 {
 };
 
 union U3 {
-  struct s1 : Virtual { // expected-note {{because type 'struct U3::s1' has a base class with a non-trivial copy constructor}}
+  struct s1 : Virtual { // expected-note {{because type 'U3::s1' has a base class with a non-trivial copy constructor}}
   } m1; // expected-error {{union member 'm1' has a non-trivial copy constructor}}
-  struct s2 : VirtualBase { // expected-note {{because type 'struct U3::s2' has a base class with a non-trivial copy constructor}}
+  struct s2 : VirtualBase { // expected-note {{because type 'U3::s2' has a base class with a non-trivial copy constructor}}
   } m2; // expected-error {{union member 'm2' has a non-trivial copy constructor}}
-  struct s3 : Ctor { // expected-note {{because type 'struct U3::s3' has a base class with a non-trivial constructor}}
+  struct s3 : Ctor { // expected-note {{because type 'U3::s3' has a base class with a non-trivial constructor}}
   } m3; // expected-error {{union member 'm3' has a non-trivial constructor}}
-  struct s3a : Ctor2 { // expected-note {{because type 'struct U3::s3a' has a base class with a non-trivial constructor}}
+  struct s3a : Ctor2 { // expected-note {{because type 'U3::s3a' has a base class with a non-trivial constructor}}
   } m3a; // expected-error {{union member 'm3a' has a non-trivial constructor}}
-  struct s4 : CopyCtor { // expected-note {{because type 'struct U3::s4' has a base class with a non-trivial copy constructor}}
+  struct s4 : CopyCtor { // expected-note {{because type 'U3::s4' has a base class with a non-trivial copy constructor}}
   } m4; // expected-error {{union member 'm4' has a non-trivial copy constructor}}
-  struct s5 : CopyAssign { // expected-note {{because type 'struct U3::s5' has a base class with a non-trivial copy assignment operator}}
+  struct s5 : CopyAssign { // expected-note {{because type 'U3::s5' has a base class with a non-trivial copy assignment operator}}
   } m5; // expected-error {{union member 'm5' has a non-trivial copy assignment operator}}
-  struct s6 : Dtor { // expected-note {{because type 'struct U3::s6' has a base class with a non-trivial destructor}}
+  struct s6 : Dtor { // expected-note {{because type 'U3::s6' has a base class with a non-trivial destructor}}
   } m6; // expected-error {{union member 'm6' has a non-trivial destructor}}
   struct s7 : Okay {
   } m7;
index 1ecbc47ffbb8e967ada91bcf595becc2727221f8..42f6343e069ea5aa7478929de936d0c2d0ee894c 100644 (file)
@@ -19,8 +19,8 @@ namespace test0 {
 namespace test1 {
   struct Derived : private Base {}; // expected-note 2 {{declared private here}}
   void test() {
-    int (Derived::*d) = data_ptr; // expected-error {{cannot cast private base class 'struct Base' to 'struct test1::Derived'}}
-    int (Derived::*m)() = method_ptr; // expected-error {{cannot cast private base class 'struct Base' to 'struct test1::Derived'}}
+    int (Derived::*d) = data_ptr; // expected-error {{cannot cast private base class 'Base' to 'test1::Derived'}}
+    int (Derived::*m)() = method_ptr; // expected-error {{cannot cast private base class 'Base' to 'test1::Derived'}}
   }
 };
 
@@ -30,8 +30,8 @@ namespace test2 {
   struct B : Base {};
   struct Derived : A, B {};
   void test() {
-    int (Derived::*d) = data_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'struct Base' to pointer to member of derived class 'struct test2::Derived'}}
-    int (Derived::*m)() = method_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'struct Base' to pointer to member of derived class 'struct test2::Derived'}}
+    int (Derived::*d) = data_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'Base' to pointer to member of derived class 'test2::Derived':}}
+    int (Derived::*m)() = method_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'Base' to pointer to member of derived class 'test2::Derived':}}
   }
 }
 
@@ -39,8 +39,8 @@ namespace test2 {
 namespace test3 {
   struct Derived : virtual Base {};
   void test() {
-    int (Derived::*d) = data_ptr;  // expected-error {{conversion from pointer to member of class 'struct Base' to pointer to member of class 'struct test3::Derived' via virtual base 'struct Base' is not allowed}}
-    int (Derived::*m)() = method_ptr; // expected-error {{conversion from pointer to member of class 'struct Base' to pointer to member of class 'struct test3::Derived' via virtual base 'struct Base' is not allowed}}
+    int (Derived::*d) = data_ptr;  // expected-error {{conversion from pointer to member of class 'Base' to pointer to member of class 'test3::Derived' via virtual base 'Base' is not allowed}}
+    int (Derived::*m)() = method_ptr; // expected-error {{conversion from pointer to member of class 'Base' to pointer to member of class 'test3::Derived' via virtual base 'Base' is not allowed}}
   }
 }
 
@@ -49,8 +49,8 @@ namespace test4 {
   struct A : Base {};
   struct Derived : Base, virtual A {};
   void test() {
-    int (Derived::*d) = data_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'struct Base' to pointer to member of derived class 'struct test4::Derived'}}
-    int (Derived::*m)() = method_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'struct Base' to pointer to member of derived class 'struct test4::Derived'}}
+    int (Derived::*d) = data_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'Base' to pointer to member of derived class 'test4::Derived':}}
+    int (Derived::*m)() = method_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'Base' to pointer to member of derived class 'test4::Derived':}}
   }
 }
 
index 7bfb655db99b4022102658863dcb91b2ae70aee4..f507eecb4223f649754cfee0db131b0716f32813 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -verify %s
 
-struct S; // expected-note {{forward declaration of 'struct S'}}
+struct S; // expected-note {{forward declaration of 'S'}}
 extern S a;
 extern S f(); // expected-note {{'f' declared here}}
 extern void g(S a); // expected-note {{candidate function}}
@@ -8,5 +8,5 @@ extern void g(S a); // expected-note {{candidate function}}
 void h() {
   // FIXME: This diagnostic could be better.
   g(a); // expected-error {{no matching function for call to 'g'}}
-  f(); // expected-error {{calling 'f' with incomplete return type 'struct S'}}
+  f(); // expected-error {{calling 'f' with incomplete return type 'S'}}
 }
index dd3df639121c03e1bc0b99f35fd7e125562d94f4..392888e71b45b97bee4e7c991e041b277a37635c 100644 (file)
@@ -52,7 +52,7 @@ void e3(union B<A>::Member);
 void e4(enum B<A>::Member); // expected-error {{use of 'Member' with tag type that does not match previous declaration}}
 
 template <class T> struct C {
-  void foo(class B<T>::Member); // expected-error{{no type named 'Member' in 'struct B<int>'}}
+  void foo(class B<T>::Member); // expected-error{{no type named 'Member' in 'B<int>'}}
 };
 
 C<float> f1;
index 7c63a79de1c67c8df05759a6213a9cb94acc7b30..d757adf6986c30838ed3868aeb0afd990db9029e 100644 (file)
@@ -16,10 +16,10 @@ struct B : A { } b;
 
 // CHECK: example1
 void example1() {
-  // CHECK: struct A &ra =
+  // CHECK: A &ra =
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase> lvalue
   A &ra = b;
-  // CHECK: struct A const &rca =
+  // CHECK: A const &rca =
   // CHECK: ImplicitCastExpr{{.*}}'struct A const' <NoOp>
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase>
   const A& rca = b;
@@ -33,12 +33,12 @@ struct X {
 
 // CHECK: example2
 void example2() {
-  // CHECK: struct A const &rca =
+  // CHECK: A const &rca =
   // CHECK: ImplicitCastExpr{{.*}}'struct A const' <NoOp>
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase>
-  // CHECK: CallExpr{{.*}}struct B
+  // CHECK: CallExpr{{.*}}B
   const A &rca = f(); 
-  // CHECK: struct A const &r =
+  // CHECK: A const &r =
   // CHECK: ImplicitCastExpr{{.*}}'struct A const' <NoOp>
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase>
   // CHECK: CXXMemberCallExpr{{.*}}'struct B'
index d9c5d014014a27c3450cf50813de5b8cf5deb22c..6a039b93ebfabddce5f8b6ac34037dcdee2d7cd4 100644 (file)
@@ -51,10 +51,10 @@ void bind_lvalue_to_lvalue(Base b, Derived d,
   Base &br1 = b;
   Base &br2 = d;
   Derived &dr1 = d;
-  Derived &dr2 = b; // expected-error{{non-const lvalue reference to type 'struct Derived' cannot bind to a value of unrelated type 'struct Base'}}
+  Derived &dr2 = b; // expected-error{{non-const lvalue reference to type 'Derived' cannot bind to a value of unrelated type 'Base'}}
   Base &br3 = bc; // expected-error{{drops qualifiers}}
   Base &br4 = dc; // expected-error{{drops qualifiers}}
-  Base &br5 = diamond; // expected-error{{ambiguous conversion from derived class 'struct Diamond' to base class 'struct Base'}}
+  Base &br5 = diamond; // expected-error{{ambiguous conversion from derived class 'Diamond' to base class 'Base':}}
   int &ir = i;
   long &lr = i; // expected-error{{non-const lvalue reference to type 'long' cannot bind to a value of unrelated type 'int'}}
 }
@@ -64,8 +64,8 @@ void bind_lvalue_quals(volatile Base b, volatile Derived d,
                        volatile const int ivc) {
   volatile Base &bvr1 = b;
   volatile Base &bvr2 = d;
-  volatile Base &bvr3 = bvc; // expected-error{{binding of reference to type 'struct Base volatile' to a value of type 'struct Base const volatile' drops qualifiers}}
-  volatile Base &bvr4 = dvc; // expected-error{{binding of reference to type 'struct Base volatile' to a value of type 'struct Derived const volatile' drops qualifiers}}
+  volatile Base &bvr3 = bvc; // expected-error{{binding of reference to type 'Base volatile' to a value of type 'Base const volatile' drops qualifiers}}
+  volatile Base &bvr4 = dvc; // expected-error{{binding of reference to type 'Base volatile' to a value of type 'Derived const volatile' drops qualifiers}}
   
   volatile int &ir = ivc; // expected-error{{binding of reference to type 'int volatile' to a value of type 'int const volatile' drops qualifiers}}
 
@@ -74,17 +74,17 @@ void bind_lvalue_quals(volatile Base b, volatile Derived d,
 }
 
 void bind_lvalue_to_rvalue() {
-  Base &br1 = Base(); // expected-error{{non-const lvalue reference to type 'struct Base' cannot bind to a temporary of type 'struct Base'}}
-  Base &br2 = Derived(); // expected-error{{non-const lvalue reference to type 'struct Base' cannot bind to a temporary of type 'struct Derived'}}
-  const volatile Base &br3 = Base(); // expected-error{{volatile lvalue reference to type 'struct Base const volatile' cannot bind to a temporary of type 'struct Base'}}
-  const volatile Base &br4 = Derived(); // expected-error{{volatile lvalue reference to type 'struct Base const volatile' cannot bind to a temporary of type 'struct Derived'}}
+  Base &br1 = Base(); // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a temporary of type 'Base'}}
+  Base &br2 = Derived(); // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a temporary of type 'Derived'}}
+  const volatile Base &br3 = Base(); // expected-error{{volatile lvalue reference to type 'Base const volatile' cannot bind to a temporary of type 'Base'}}
+  const volatile Base &br4 = Derived(); // expected-error{{volatile lvalue reference to type 'Base const volatile' cannot bind to a temporary of type 'Derived'}}
 
   int &ir = 17; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}}
 }
 
 void bind_lvalue_to_unrelated(Unrelated ur) {
-  Base &br1 = ur; // expected-error{{non-const lvalue reference to type 'struct Base' cannot bind to a value of unrelated type 'struct Unrelated'}}
-  const volatile Base &br2 = ur; // expected-error{{volatile lvalue reference to type 'struct Base const volatile' cannot bind to a value of unrelated type 'struct Unrelated'}}
+  Base &br1 = ur; // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a value of unrelated type 'Unrelated'}}
+  const volatile Base &br2 = ur; // expected-error{{volatile lvalue reference to type 'Base const volatile' cannot bind to a value of unrelated type 'Unrelated'}}
 }
 
 void bind_lvalue_to_conv_lvalue() {
@@ -97,7 +97,7 @@ void bind_lvalue_to_conv_lvalue() {
 
 void bind_lvalue_to_conv_lvalue_ambig(ConvertibleToBothDerivedRef both) {
   Derived &dr1 = both;
-  Base &br1 = both; // expected-error{{reference initialization of type 'struct Base &' with initializer of type 'struct ConvertibleToBothDerivedRef' is ambiguous}}
+  Base &br1 = both; // expected-error{{reference initialization of type 'Base &' with initializer of type 'ConvertibleToBothDerivedRef' is ambiguous}}
 }
 
 struct IntBitfield {
@@ -118,8 +118,8 @@ void bind_const_lvalue_to_rvalue() {
   const Base &br3 = create<const Base>();
   const Base &br4 = create<const Derived>();
 
-  const Base &br5 = create<const volatile Base>(); // expected-error{{binding of reference to type 'struct Base const' to a value of type 'struct Base const volatile' drops qualifiers}}
-  const Base &br6 = create<const volatile Derived>(); // expected-error{{binding of reference to type 'struct Base const' to a value of type 'struct Derived const volatile' drops qualifiers}}
+  const Base &br5 = create<const volatile Base>(); // expected-error{{binding of reference to type 'Base const' to a value of type 'Base const volatile' drops qualifiers}}
+  const Base &br6 = create<const volatile Derived>(); // expected-error{{binding of reference to type 'Base const' to a value of type 'Derived const volatile' drops qualifiers}}
 
   const int &ir = create<int>();
 }
@@ -131,5 +131,5 @@ void bind_const_lvalue_to_class_conv_temporary() {
 }
 void bind_lvalue_to_conv_rvalue_ambig(ConvertibleToBothDerived both) {
   const Derived &dr1 = both;
-  const Base &br1 = both; // expected-error{{reference initialization of type 'struct Base const &' with initializer of type 'struct ConvertibleToBothDerived' is ambiguous}}
+  const Base &br1 = both; // expected-error{{reference initialization of type 'Base const &' with initializer of type 'ConvertibleToBothDerived' is ambiguous}}
 }
index df5dcfe97a74774dfa94c0ddf3e0e9ee0864589b..c542dac1db1d9d4737cc67ac4c17065ecc316d53 100644 (file)
@@ -10,7 +10,7 @@ struct NoUserDefault : public MakeNonPOD { };
 struct HasUserDefault { HasUserDefault(); };
 
 void test_const_default_init() {
-  const NoUserDefault x1; // expected-error{{default initialization of an object of const type 'struct NoUserDefault const' requires a user-provided default constructor}}
+  const NoUserDefault x1; // expected-error{{default initialization of an object of const type 'NoUserDefault const' requires a user-provided default constructor}}
   const HasUserDefault x2;
   const int x3; // expected-error{{default initialization of an object of const type 'int const'}}
 }
index 561e26b068f4b72c44db6bee06dfd5d86951262f..7e35788d898bec5ee9d3c9eb4b3cef44689c720d 100644 (file)
@@ -16,11 +16,11 @@ void f() {
   int b;
   A a(b); 
   
-  int A::*ip = &A::s; // expected-error {{cannot initialize a variable of type 'int class A::*' with an rvalue of type 'int *'}}
+  int A::*ip = &A::s; // expected-error {{cannot initialize a variable of type 'int A::*' with an rvalue of type 'int *'}}
   a.*&A::s = 10; // expected-error{{right hand operand to .* has non pointer-to-member type 'int *'}}
   
   a.*&A::i = 10; // expected-error{{cannot form a pointer-to-member to member 'i' of reference type 'int &'}}
-  ft(a); // expected-note{{in instantiation of function template specialization 'ft<class A>' requested here}}
+  ft(a); // expected-note{{in instantiation of function template specialization 'ft<A>' requested here}}
   
   void A::*p = 0; // expected-error{{'p' declared as a member pointer to void}}
 }
index 5467717bbc77e17a8782b578b52692e8852d9e21..04d2a2f0c9813ef9eaaa85167fd52cd09b497396 100644 (file)
@@ -18,10 +18,10 @@ void f();
 void test() {
   f(Y(), 0, 0);
   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC1 %s
-  // CHECK-CC1: f(struct N::Y y, <#int ZZ#>)
+  // CHECK-CC1: f(N::Y y, <#int ZZ#>)
   // CHECK-CC1-NEXT: f(int i, <#int j#>, int k)
   // CHECK-CC1-NEXT: f(float x, <#float y#>)
   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CC2 %s
-  // CHECK-CC2-NOT: f(struct N::Y y, int ZZ)
+  // CHECK-CC2-NOT: f(N::Y y, int ZZ)
   // CHECK-CC2: f(int i, int j, <#int k#>)
 }
index b9efcb43ed2b67f3ef01f57fa76d5f3bc2c2b771..e74ec9b5fe6707ec3ed473a6aa7d05bddf5d06c3 100644 (file)
@@ -22,11 +22,11 @@ void test(enum N::C::Color color) {
   switch (color) {
   case 
     // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CC1 %s
-    // CHECK-CC1: Blue : [#enum M::N::C::Color#]N::C::Blue
-    // CHECK-CC1-NEXT: Green : [#enum M::N::C::Color#]N::C::Green
-    // CHECK-CC1-NEXT: Indigo : [#enum M::N::C::Color#]N::C::Indigo
-    // CHECK-CC1-NEXT: Orange : [#enum M::N::C::Color#]N::C::Orange
-    // CHECK-CC1-NEXT: Red : [#enum M::N::C::Color#]N::C::Red
-    // CHECK-CC1-NEXT: Violet : [#enum M::N::C::Color#]N::C::Violet
-    // CHECK-CC1: Yellow : [#enum M::N::C::Color#]N::C::Yellow
+    // CHECK-CC1: Blue : [#M::N::C::Color#]N::C::Blue
+    // CHECK-CC1-NEXT: Green : [#M::N::C::Color#]N::C::Green
+    // CHECK-CC1-NEXT: Indigo : [#M::N::C::Color#]N::C::Indigo
+    // CHECK-CC1-NEXT: Orange : [#M::N::C::Color#]N::C::Orange
+    // CHECK-CC1-NEXT: Red : [#M::N::C::Color#]N::C::Red
+    // CHECK-CC1-NEXT: Violet : [#M::N::C::Color#]N::C::Violet
+    // CHECK-CC1: Yellow : [#M::N::C::Color#]N::C::Yellow
       
index 412f5f2f074d005187da983f9eef0f5e925c1304..2677f33f98f27308d3f59acafeb14ab5b3c808db 100644 (file)
@@ -20,9 +20,9 @@ void test(enum N::Color color) {
     
   case 
     // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:21:8 %s -o - | FileCheck -check-prefix=CC1 %s
-    // CHECK-CC1: Blue : [#enum N::Color#]N::Blue
-    // CHECK-CC1-NEXT: Green : [#enum N::Color#]N::Green
-    // CHECK-CC1-NEXT: Indigo : [#enum N::Color#]N::Indigo
-    // CHECK-CC1-NEXT: Orange : [#enum N::Color#]N::Orange
-    // CHECK-CC1-NEXT: Violet : [#enum N::Color#]N::Violet
+    // CHECK-CC1: Blue : [#N::Color#]N::Blue
+    // CHECK-CC1-NEXT: Green : [#N::Color#]N::Green
+    // CHECK-CC1-NEXT: Indigo : [#N::Color#]N::Indigo
+    // CHECK-CC1-NEXT: Orange : [#N::Color#]N::Orange
+    // CHECK-CC1-NEXT: Violet : [#N::Color#]N::Violet
     
index c0570258c53b5b75951729e71ab47f794fb68d22..efc9ba890c6fabd17007779d658430fcbd3a9c34 100644 (file)
@@ -31,12 +31,12 @@ bool test_string(std::string s) {
   std::basic_sting<char> b2; // expected-error{{no template named 'basic_sting' in namespace 'std'; did you mean 'basic_string'?}}
   (void)b1;
   (void)b2;
-  return s.fnd("hello") // expected-error{{no member named 'fnd' in 'class std::basic_string<char>'; did you mean 'find'?}}
-    == std::string::pos; // expected-error{{no member named 'pos' in 'class std::basic_string<char>'; did you mean 'npos'?}}
+  return s.fnd("hello") // expected-error{{no member named 'fnd' in 'std::basic_string<char>'; did you mean 'find'?}}
+    == std::string::pos; // expected-error{{no member named 'pos' in 'std::basic_string<char>'; did you mean 'npos'?}}
 }
 
 struct Base { };
-struct Derived : public Base { // expected-note{{base class 'struct Base' specified here}}
+struct Derived : public Base { // expected-note{{base class 'Base' specified here}}
   int member; // expected-note 3{{'member' declared here}}
 
   Derived() : base(), // expected-error{{initializer 'base' does not name a non-static data member or base class; did you mean the base class 'Base'?}}
index 7fd4376735a04397ee842931ad6737a38dd1a248..670b13f6344b5d3498b17a73d71597d4b7b5aa19 100644 (file)
@@ -38,10 +38,10 @@ void test_overloaded() {
 // CHECK-MEMBER: FieldDecl:{ResultType float}{Text Y::}{TypedText member}
 // CHECK-MEMBER: FunctionDecl:{ResultType void}{Informative Y::}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )}
 // CHECK-MEMBER: FunctionDecl:{ResultType int}{TypedText operator int}{LeftParen (}{RightParen )}{Informative  const}
-// CHECK-MEMBER: FunctionDecl:{ResultType struct Z &}{TypedText operator=}{LeftParen (}{Placeholder struct Z const &}{RightParen )}
-// CHECK-MEMBER: FunctionDecl:{ResultType struct X &}{Text X::}{TypedText operator=}{LeftParen (}{Placeholder struct X const &}{RightParen )}
-// CHECK-MEMBER: FunctionDecl:{ResultType struct Y &}{Text Y::}{TypedText operator=}{LeftParen (}{Placeholder struct Y const &}{RightParen )}
-// CHECK-MEMBER: EnumConstantDecl:{ResultType enum X::E}{Informative E::}{TypedText Val1}
+// CHECK-MEMBER: FunctionDecl:{ResultType Z &}{TypedText operator=}{LeftParen (}{Placeholder Z const &}{RightParen )}
+// CHECK-MEMBER: FunctionDecl:{ResultType X &}{Text X::}{TypedText operator=}{LeftParen (}{Placeholder X const &}{RightParen )}
+// CHECK-MEMBER: FunctionDecl:{ResultType Y &}{Text Y::}{TypedText operator=}{LeftParen (}{Placeholder Y const &}{RightParen )}
+// CHECK-MEMBER: EnumConstantDecl:{ResultType X::E}{Informative E::}{TypedText Val1}
 // CHECK-MEMBER: StructDecl:{TypedText X}{Text ::}
 // CHECK-MEMBER: StructDecl:{TypedText Y}{Text ::}
 // CHECK-MEMBER: StructDecl:{TypedText Z}{Text ::}
@@ -49,6 +49,6 @@ void test_overloaded() {
 // CHECK-MEMBER: FunctionDecl:{ResultType void}{Informative Y::}{TypedText ~Y}{LeftParen (}{RightParen )}
 // CHECK-MEMBER: FunctionDecl:{ResultType void}{TypedText ~Z}{LeftParen (}{RightParen )}
 
-// CHECK-OVERLOAD: NotImplemented:{ResultType int &}{Text overloaded}{LeftParen (}{Text struct Z z}{Comma , }{CurrentParameter int second}{RightParen )}
+// CHECK-OVERLOAD: NotImplemented:{ResultType int &}{Text overloaded}{LeftParen (}{Text Z z}{Comma , }{CurrentParameter int second}{RightParen )}
 // CHECK-OVERLOAD: NotImplemented:{ResultType float &}{Text overloaded}{LeftParen (}{Text int i}{Comma , }{CurrentParameter long second}{RightParen )}
 // CHECK-OVERLOAD: NotImplemented:{ResultType double &}{Text overloaded}{LeftParen (}{Text float f}{Comma , }{CurrentParameter int second}{RightParen )}
index d0b0fb8ee2235b09ec269834a3850200af751ac6..eeb5f1c86fc39378bc12024860deb08846e8eeb9 100644 (file)
@@ -5,7 +5,7 @@ class A { };
 class B : private A { }; // expected-note {{declared private here}}
 
 void f(B* b) {
-  A *a = b; // expected-error{{cannot cast 'class T1::B' to its private base class 'class T1::A'}}
+  A *a = b; // expected-error{{cannot cast 'T1::B' to its private base class 'T1::A'}}
 }
 
 }
@@ -16,7 +16,7 @@ class A { };
 class B : A { }; // expected-note {{implicitly declared private here}}
 
 void f(B* b) {
-  A *a = b; // expected-error {{cannot cast 'class T2::B' to its private base class 'class T2::A'}}
+  A *a = b; // expected-error {{cannot cast 'T2::B' to its private base class 'T2::A'}}
 }
 
 }
@@ -69,7 +69,7 @@ namespace T6 {
   
   class C : public B { 
     void f(C *c) {
-      A* a = c; // expected-error {{cannot cast 'class T6::C' to its private base class 'class T6::A'}}
+      A* a = c; // expected-error {{cannot cast 'T6::C' to its private base class 'T6::A'}}
     }
   };
   
index 783d4def5327c3e5efad7460d7586753a47f9e12..1db6704909df4a2865ae8cf1c6396a062a278148 100644 (file)
@@ -11,5 +11,5 @@ class P {
 
 class N : M,P {
   N() {}
-  int PR() { return iP + PPR(); } // expected-error 2 {{private member of 'class P'}}
+  int PR() { return iP + PPR(); } // expected-error 2 {{private member of 'P'}}
 };
index 83f4179d91364114ea6c16aecd4d3fdfe55f50da..708a8f256a3d4fb1efe487f25f9c323843d6d087 100644 (file)
@@ -22,10 +22,10 @@ struct NonAggr4 {
   virtual void f();
 };
 
-NonAggr1 na1 = { 17 }; // expected-error{{non-aggregate type 'struct NonAggr1' cannot be initialized with an initializer list}}
-NonAggr2 na2 = { 17 }; // expected-error{{non-aggregate type 'struct NonAggr2' cannot be initialized with an initializer list}}
-NonAggr3 na3 = { 17 }; // expected-error{{non-aggregate type 'class NonAggr3' cannot be initialized with an initializer list}}
-NonAggr4 na4 = { 17 }; // expected-error{{non-aggregate type 'struct NonAggr4' cannot be initialized with an initializer list}}
+NonAggr1 na1 = { 17 }; // expected-error{{non-aggregate type 'NonAggr1' cannot be initialized with an initializer list}}
+NonAggr2 na2 = { 17 }; // expected-error{{non-aggregate type 'NonAggr2' cannot be initialized with an initializer list}}
+NonAggr3 na3 = { 17 }; // expected-error{{non-aggregate type 'NonAggr3' cannot be initialized with an initializer list}}
+NonAggr4 na4 = { 17 }; // expected-error{{non-aggregate type 'NonAggr4' cannot be initialized with an initializer list}}
 
 // PR5817
 typedef int type[][2];
@@ -60,10 +60,10 @@ struct C {
 
 void f() {
   A as1[1] = { };
-  A as2[1] = { 1 }; // expected-error {{copying array element of type 'struct A' invokes deleted copy constructor}}
+  A as2[1] = { 1 }; // expected-error {{copying array element of type 'A' invokes deleted copy constructor}}
 
   B b1 = { };
-  B b2 = { 1 }; // expected-error {{copying member subobject of type 'struct A' invokes deleted copy constructor}}
+  B b2 = { 1 }; // expected-error {{copying member subobject of type 'A' invokes deleted copy constructor}}
   
   C c1 = { 1 };
 }
index 5e0a2e3766f88144fcc4971ef1cc886f80800d50..7f676748740ccf7a3a50bbde84639b44a783aaf4 100644 (file)
@@ -19,7 +19,7 @@ namespace test0 {
 
   const int Test1() {
     func(b1, f()); // expected-error {{call to 'func' is ambiguous}}
-    return f(); // expected-error {{conversion from 'struct test0::B' to 'int const' is ambiguous}}
+    return f(); // expected-error {{conversion from 'test0::B' to 'int const' is ambiguous}}
   }
 
   // This used to crash when comparing the two operands.
index fd1ec0120a71ae6ad280dc25a4256d8898484e88..29b23edad3a17cb7b5c3347e0bf318e1bfec017f 100644 (file)
@@ -16,7 +16,7 @@ struct C : A, B {
 
 struct D : A { };
 
-struct E; // expected-note {{forward declaration of 'struct E'}}
+struct E; // expected-note {{forward declaration of 'E'}}
 
 void f(C &c, D& d, E& e) {
   c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}}
index 9924d1bc5707bc06724ca785df73e0eb1caa2ff6..8fbf50c26ec1fa3a88b37f4d3080d7f9bb236dc9 100644 (file)
@@ -2,7 +2,7 @@
 
 int final_fail [[final]]; //expected-error {{'final' attribute only applies to virtual method or class types}}
 
-struct [[final]] final_base { }; // expected-note {{'struct final_base' declared here}}
+struct [[final]] final_base { }; // expected-note {{'final_base' declared here}}
 struct final_child : final_base { }; // expected-error {{derivation from 'final' struct final_base}}
 
 struct final_member { virtual void quux [[final]] (); }; // expected-note {{overridden virtual function is here}}
index b1b0b98b3c06353299ebe868f76cd73880245ca6..f736394a4caaa88e801dd73b10da02a3ffdc14bc 100644 (file)
@@ -41,6 +41,6 @@ void foo1(C1 c1, int A::* pmf) {
 
 void foo1(C1 c1, int E::* pmf) {
         int i = c1->*pmf;      // expected-error {{use of overloaded operator '->*' is ambiguous}} \
-                                // expected-note {{because of ambiguity in conversion of 'struct C1' to 'struct E *'}} \
+                                // expected-note {{because of ambiguity in conversion of 'C1' to 'E *'}} \
                                 // expected-note 4 {{built-in candidate operator}}
 }
index 074e1330403de68e5320d8efcf7d1bccb507fc60..d68e789c370f72051ebd9ed124d44e420a8bc86b 100644 (file)
@@ -13,9 +13,9 @@ struct B {
 };
 
 int main () {
-  B(10);       // expected-error {{functional-style cast from 'int' to 'struct B' is not allowed}}
-  (B)10;       // expected-error {{C-style cast from 'int' to 'struct B' is not allowed}}
-  static_cast<B>(10);  // expected-error {{static_cast from 'int' to 'struct B' is not allowed}} \\
+  B(10);       // expected-error {{functional-style cast from 'int' to 'B' is not allowed}}
+  (B)10;       // expected-error {{C-style cast from 'int' to 'B' is not allowed}}
+  static_cast<B>(10);  // expected-error {{static_cast from 'int' to 'B' is not allowed}} \\
                        // expected-warning {{expression result unused}}
 }
 
index 67bc43c2e80bee6e560e2dc86d53c57a1f13064f..1c6e79012ea511215088ebb147bd3fdb7c315afd 100644 (file)
@@ -8,7 +8,7 @@ public:
 struct D : S {
   D() : b1(0), b2(1), b1(0), S(), S() {} // expected-error {{multiple initializations given for non-static member 'b1'}} \
                                          // expected-note {{previous initialization is here}}                  \
-                                         // expected-error {{multiple initializations given for base 'class S'}} \
+                                         // expected-error {{multiple initializations given for base 'S'}} \
                                          // expected-note {{previous initialization is here}}
 
   int b1;
index b961ff2de91005fe8191ff86232538a3368d5e6f..4fcb0bb98dc0cbcba50b4057359df0eb95fdfaea 100644 (file)
@@ -85,7 +85,7 @@ void test()
   // these are ambiguous
   BadBase bb;
   BadDerived bd;
-  (void)(i1 ? bb : bd); // expected-error {{conditional expression is ambiguous; 'struct BadBase' can be converted to 'struct BadDerived' and vice versa}}
+  (void)(i1 ? bb : bd); // expected-error {{conditional expression is ambiguous; 'BadBase' can be converted to 'BadDerived' and vice versa}}
   (void)(i1 ? bd : bb); // expected-error {{conditional expression is ambiguous}}
   // curiously enough (and a defect?), these are not
   // for rvalues, hierarchy takes precedence over other conversions
@@ -106,19 +106,19 @@ void test()
   i1 = (i1 ? Base() : Derived()).trick();
   i1 = (i1 ? Derived() : Base()).trick();
   // should fail: const lost
-  (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('struct Base' and 'struct Derived const')}}
-  (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('struct Derived const' and 'struct Base')}}
+  (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('Base' and 'Derived const')}}
+  (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('Derived const' and 'Base')}}
 
   Priv priv;
   Fin fin;
   (void)(i1 ? Base() : Priv()); // expected-error{{private base class}}
   (void)(i1 ? Priv() : Base()); // expected-error{{private base class}}
-  (void)(i1 ? Base() : Fin()); // expected-error{{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}}
-  (void)(i1 ? Fin() : Base()); // expected-error{{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}}
+  (void)(i1 ? Base() : Fin()); // expected-error{{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
+  (void)(i1 ? Fin() : Base()); // expected-error{{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
   (void)(i1 ? base : priv); // expected-error {{private base class}}
   (void)(i1 ? priv : base); // expected-error {{private base class}}
-  (void)(i1 ? base : fin); // expected-error {{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}}
-  (void)(i1 ? fin : base); // expected-error {{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}}
+  (void)(i1 ? base : fin); // expected-error {{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
+  (void)(i1 ? fin : base); // expected-error {{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
 
   // b2.2 (non-hierarchy)
   i1 = i1 ? I() : i1;
@@ -128,10 +128,10 @@ void test()
   // "the type [it] woud have if E2 were converted to an rvalue"
   vfn pfn = i1 ? F() : test;
   pfn = i1 ? test : F();
-  (void)(i1 ? A() : B()); // expected-error {{conversion from 'struct B' to 'struct A' is ambiguous}}
-  (void)(i1 ? B() : A()); // expected-error {{conversion from 'struct B' to 'struct A' is ambiguous}}
-  (void)(i1 ? 1 : Ambig()); // expected-error {{conversion from 'struct Ambig' to 'int' is ambiguous}}
-  (void)(i1 ? Ambig() : 1); // expected-error {{conversion from 'struct Ambig' to 'int' is ambiguous}}
+  (void)(i1 ? A() : B()); // expected-error {{conversion from 'B' to 'A' is ambiguous}}
+  (void)(i1 ? B() : A()); // expected-error {{conversion from 'B' to 'A' is ambiguous}}
+  (void)(i1 ? 1 : Ambig()); // expected-error {{conversion from 'Ambig' to 'int' is ambiguous}}
+  (void)(i1 ? Ambig() : 1); // expected-error {{conversion from 'Ambig' to 'int' is ambiguous}}
   // By the way, this isn't an lvalue:
   &(i1 ? i1 : i2); // expected-error {{address expression must be an lvalue or a function designator}}
 
index 220e6faeee3c40dac63d6bcec73b098baf519dd1..50bd3162780b14dd978d20d1a029e3af4d8d42b0 100644 (file)
@@ -59,6 +59,6 @@ short *bad_const_cast_test(char const *volatile *const volatile *var)
   // Function pointers.
   f fp2 = const_cast<f>(fp1); // expected-error {{const_cast to 'f' (aka 'int (*)(int)'), which is not a reference, pointer-to-object, or pointer-to-data-member}}
   void (A::*mfn)() = 0;
-  (void)const_cast<void (A::*)()>(mfn); // expected-error {{const_cast to 'void (struct A::*)()', which is not a reference, pointer-to-object, or pointer-to-data-member}}
+  (void)const_cast<void (A::*)()>(mfn); // expected-error {{const_cast to 'void (A::*)()', which is not a reference, pointer-to-object, or pointer-to-data-member}}
   return **var3;
 }
index 2efb7b9c2145920d3694c602cf14722438ea2825..96dfa8ba5269ec2ae73712750426a31260dd256b 100644 (file)
@@ -27,7 +27,7 @@ public:
 
 class E : public D, public B { 
 public:
-  E() : B(), D() { } // expected-error{{base class initializer 'class B' names both a direct base class and an inherited virtual base class}}
+  E() : B(), D() { } // expected-error{{base class initializer 'B' names both a direct base class and an inherited virtual base class}}
 };
 
 
@@ -65,7 +65,7 @@ struct S : Y, virtual X {
 };
 
 struct Z : S { 
-  Z() : X(), S(), E()  {} // expected-error {{type 'class E' is not a direct or virtual base of 'Z'}}
+  Z() : X(), S(), E()  {} // expected-error {{type 'E' is not a direct or virtual base of 'Z'}}
 };
 
 class U { 
@@ -104,13 +104,13 @@ struct M {              // expected-note 2 {{candidate constructor (the implicit
 };
 
 struct N : M  {
-  N() : M(1),        // expected-error {{no matching constructor for initialization of 'struct M'}}
-        m1(100) {  } // expected-error {{no matching constructor for initialization of 'struct M'}}
+  N() : M(1),        // expected-error {{no matching constructor for initialization of 'M'}}
+        m1(100) {  } // expected-error {{no matching constructor for initialization of 'M'}}
   M m1;
 };
 
 struct P : M  {
-  P()  {  } // expected-error {{base class 'struct M'}} \
+  P()  {  } // expected-error {{constructor for 'P' must explicitly initialize the base class 'M' which does not have a default constructor}} \
             // expected-error {{member 'm'}}
   M m; // expected-note {{member is declared here}}
 };
index 2338778ebaac217b0305608c63825b502b8c3b95..862ae5ae02bb031a374571e17baadd9d289af28f 100644 (file)
@@ -11,7 +11,7 @@ struct D : B {
 
 void f (D d)
 {
-   delete d; // expected-error {{ambiguous conversion of delete expression of type 'struct D' to a pointer}}
+   delete d; // expected-error {{ambiguous conversion of delete expression of type 'D' to a pointer}}
 }
 
 // Test2
@@ -39,7 +39,7 @@ struct D2 : B2 {
 
 void f2 (D2 d)
 {
-   delete d; // expected-error {{ambiguous conversion of delete expression of type 'struct D2' to a pointer}}
+   delete d; // expected-error {{ambiguous conversion of delete expression of type 'D2' to a pointer}}
 }
 
 // Test4
@@ -56,7 +56,7 @@ struct D3 : A3, B3 {
 
 void f3 (D3 d)
 {
-   delete d; // expected-error {{mbiguous conversion of delete expression of type 'struct D3' to a pointer}}
+   delete d; // expected-error {{ambiguous conversion of delete expression of type 'D3' to a pointer}}
 }
 
 // Test5
index 4fef172bd5a1a0095069f4fdce14850dd36d54f7..bca75c0b2fb5acf355793a99d40929eb28aaefdd 100644 (file)
@@ -49,9 +49,9 @@ class A { };
 
 class B : public A {
 public:
-  operator A&() const; // expected-warning{{conversion function converting 'class B' to its base class 'class A' will never be used}}
-  operator const void() const; // expected-warning{{conversion function converting 'class B' to 'void const' will never be used}}
-  operator const B(); // expected-warning{{conversion function converting 'class B' to itself will never be used}}
+  operator A&() const; // expected-warning{{conversion function converting 'B' to its base class 'A' will never be used}}
+  operator const void() const; // expected-warning{{conversion function converting 'B' to 'void const' will never be used}}
+  operator const B(); // expected-warning{{conversion function converting 'B' to itself will never be used}}
 };
 
 // This used to crash Clang.
@@ -63,7 +63,7 @@ struct Flop { // expected-note{{candidate is the implicit copy constructor}}
 struct Flip {
   operator Flop() const; // expected-note{{candidate function}}
 };
-Flop flop = Flip(); // expected-error {{conversion from 'struct Flip' to 'struct Flop' is ambiguous}}
+Flop flop = Flip(); // expected-error {{conversion from 'Flip' to 'Flop' is ambiguous}}
 
 // This tests that we don't add the second conversion declaration to the list of user conversions
 struct C {
@@ -88,7 +88,7 @@ public:
 };
 
 void f(Yb& a) {
-  if (a) { } // expected-error {{conversion from 'class Yb' to 'bool' is ambiguous}}
+  if (a) { } // expected-error {{conversion from 'Yb' to 'bool' is ambiguous}}
   int i = a; // OK. calls XB::operator int();
   char ch = a;  // OK. calls Yb::operator char();
 }
index 4b5002e44a0187fa424f4712266c69b237e52438..4cd22e90c0e08d4c5ff77a40ffd82152ce693b52 100644 (file)
@@ -44,12 +44,12 @@ struct ExplicitConvToRef {
 
 void test_explicit_bool(ExplicitConvToBool ecb) {
   bool b1(ecb); // okay
-  bool b2 = ecb; // expected-error{{no viable conversion from 'struct ExplicitConvToBool' to 'bool'}}
+  bool b2 = ecb; // expected-error{{no viable conversion from 'ExplicitConvToBool' to 'bool'}}
   accepts_bool(ecb); // expected-error{{no matching function for call to}}
 }
 
 void test_explicit_conv_to_ref(ExplicitConvToRef ecr) {
-  int& i1 = ecr; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a value of unrelated type 'struct ExplicitConvToRef'}}
+  int& i1 = ecr; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a value of unrelated type 'ExplicitConvToRef'}}
   int& i2(ecr); // okay
 }
 
@@ -61,7 +61,7 @@ struct C {
 };
 
 void test_copy_init_conversions(C c) {
-  A &a = c; // expected-error{{no viable conversion from 'struct C' to 'struct A'}}
+  A &a = c; // expected-error{{no viable conversion from 'C' to 'A'}}
   B &b = b; // okay
 }
 
index d7eb5cf1e60da6a2ee287e843ccb1af3f0f007f1..8cdb1be487633a819752b8e4c36f2269857b3afa 100644 (file)
@@ -94,6 +94,6 @@ void test() {
 
   int i;
   i = convertibleToInt;
-  i = a; // expected-error{{incompatible type assigning 'struct A', expected 'int'}}
+  i = a; // expected-error{{incompatible type assigning 'A', expected 'int'}}
 }
 
index 2cf878a84411be7fb27d862b7b2548948bd08692..3a63be0970de542621b516dca118d8f66096a648 100644 (file)
@@ -9,7 +9,7 @@ public:
 class Y : public X { };
 
 void f(Y y, int *ip, float *fp) {
-  X x1 = y; // expected-error{{no matching constructor for initialization of 'class X'}}
+  X x1 = y; // expected-error{{no matching constructor for initialization of 'X'}}
   X x2 = 0;
   X x3 = ip;
   X x4 = fp; // expected-error{{no viable conversion}}
@@ -20,4 +20,4 @@ struct foo {
 };
 
 // PR3600
-void test(const foo *P) { P->bar(); } // expected-error{{cannot initialize object parameter of type 'struct foo' with an expression of type 'struct foo const'}}
+void test(const foo *P) { P->bar(); } // expected-error{{cannot initialize object parameter of type 'foo' with an expression of type 'foo const'}}
index dbb1e4a18a2ecd906ce463e3d6222ad07319d213..6a28f4c2c87503a6ff9a0b64872a813a60fb4f56 100644 (file)
@@ -122,12 +122,12 @@ void t_529_5_8()
 
   // Bad code below
 
-  (void)(C1*)((A*)0); // expected-error {{cannot cast 'struct A *' to 'struct C1 *' via virtual base 'struct B'}}
-  (void)(C1&)(*((A*)0)); // expected-error {{cannot cast 'struct A' to 'struct C1 &' via virtual base 'struct B'}}
-  (void)(D*)((A*)0); // expected-error {{cannot cast 'struct A *' to 'struct D *' via virtual base 'struct B'}}
-  (void)(D&)(*((A*)0)); // expected-error {{cannot cast 'struct A' to 'struct D &' via virtual base 'struct B'}}
-  (void)(H*)((A*)0); // expected-error {{ambiguous cast from base 'struct A' to derived 'struct H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
-  (void)(H&)(*((A*)0)); // expected-error {{ambiguous cast from base 'struct A' to derived 'struct H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
+  (void)(C1*)((A*)0); // expected-error {{cannot cast 'A *' to 'C1 *' via virtual base 'B'}}
+  (void)(C1&)(*((A*)0)); // expected-error {{cannot cast 'A' to 'C1 &' via virtual base 'B'}}
+  (void)(D*)((A*)0); // expected-error {{cannot cast 'A *' to 'D *' via virtual base 'B'}}
+  (void)(D&)(*((A*)0)); // expected-error {{cannot cast 'A' to 'D &' via virtual base 'B'}}
+  (void)(H*)((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
+  (void)(H&)(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
 
   // TODO: Test DR427. This requires user-defined conversions, though.
 }
@@ -141,7 +141,7 @@ void t_529_7()
 
   // Bad code below
 
-  (void)(Enum)((int*)0); // expected-error {{C-style cast from 'int *' to 'enum Enum' is not allowed}}
+  (void)(Enum)((int*)0); // expected-error {{C-style cast from 'int *' to 'Enum' is not allowed}}
 }
 
 // Void pointer to object pointer
@@ -158,8 +158,8 @@ void t_529_9()
   (void)(int A::*)((int B::*)0);
 
   // Bad code below
-  (void)(int A::*)((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'struct H'}}
-  (void)(int A::*)((int F::*)0); // expected-error {{conversion from pointer to member of class 'struct F'}}
+  (void)(int A::*)((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'H' to pointer to member of base class 'A':}}
+  (void)(int A::*)((int F::*)0); // expected-error {{conversion from pointer to member of class 'F' to pointer to member of class 'A' via virtual base 'B' is not allowed}}
 }
 
 // -------- reinterpret_cast -----------
@@ -226,6 +226,6 @@ void memptrs()
   void (structure::*psf)() = 0;
   (void)(int (structure::*)())(psf);
 
-  (void)(void (structure::*)())(psi); // expected-error {{C-style cast from 'int const struct structure::*' to 'void (struct structure::*)()' is not allowed}}
-  (void)(int structure::*)(psf); // expected-error {{C-style cast from 'void (struct structure::*)()' to 'int struct structure::*' is not allowed}}
+  (void)(void (structure::*)())(psi); // expected-error {{C-style cast from 'int const structure::*' to 'void (structure::*)()' is not allowed}}
+  (void)(int structure::*)(psf); // expected-error {{C-style cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
 }
index 461c60b5bbc12ce3835517a27307f6a8ceb3b30b..8b286634446278011182cf6960a2affc2869ad26 100644 (file)
@@ -13,9 +13,9 @@ struct NonAggregate {
 
   int a, b;
 };
-NonAggregate non_aggregate_test = { 1, 2 }; // expected-error{{non-aggregate type 'struct NonAggregate' cannot be initialized with an initializer list}}
+NonAggregate non_aggregate_test = { 1, 2 }; // expected-error{{non-aggregate type 'NonAggregate' cannot be initialized with an initializer list}}
 
-NonAggregate non_aggregate_test2[2] = { { 1, 2 }, { 3, 4 } }; // expected-error 2 {{initialization of non-aggregate type 'struct NonAggregate' with an initializer list}}
+NonAggregate non_aggregate_test2[2] = { { 1, 2 }, { 3, 4 } }; // expected-error 2 {{initialization of non-aggregate type 'NonAggregate' with an initializer list}}
 
 
 // C++ [dcl.init.aggr]p3
@@ -51,7 +51,7 @@ struct TooFewError { // expected-error{{implicit default constructor for}}
 TooFewError too_few_okay = { 1, 1 };
 TooFewError too_few_error = { 1 }; // expected-error{{no matching constructor}}
 
-TooFewError too_few_okay2[2] = { 1, 1 }; // expected-note{{implicit default constructor for 'struct TooFewError' first required here}}
+TooFewError too_few_okay2[2] = { 1, 1 }; // expected-note{{implicit default constructor for 'TooFewError' first required here}}
 TooFewError too_few_error2[2] = { 1 }; // expected-error{{no matching constructor}}
 
 NoDefaultConstructor too_few_error3[3] = { }; // expected-error {{no matching constructor}}
index 2f7d8a4c77efda9b6481e9fe24ef1be5c8345b84..7ae043925214ba28bfe137c08b16cf533300283c 100644 (file)
@@ -21,9 +21,9 @@ extern B f();
 const int& ri = (void)0; // expected-error {{reference to type 'int const' could not bind to an rvalue of type 'void'}}
 
 int main() {
-        const A& rca = f(); // expected-error {{reference initialization of type 'struct A const &' with initializer of type 'class B' is ambiguous}}
-        A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot bind to a temporary of type 'class B'}}
+        const A& rca = f(); // expected-error {{reference initialization of type 'A const &' with initializer of type 'B' is ambiguous}}
+        A& ra = f(); // expected-error {{non-const lvalue reference to type 'A' cannot bind to a temporary of type 'B'}}
 }
 
 struct PR6139 { A (&x)[1]; };
-PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'struct A [1]' cannot bind to a temporary of type 'struct A'}}
+PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to a temporary of type 'A'}}
index 906e868a42821452631ea6ee3c2b6862854ad451..0aa49b0cec90ff3f6c6295fc3784267ff537892f 100644 (file)
@@ -9,4 +9,4 @@ template<typename T> struct S {
 };
 
 struct K { void f(); void f(int); };
-S<K> b; // expected-note{{in instantiation of template class 'struct S<struct K>' requested here}}
+S<K> b; // expected-note{{in instantiation of template class 'S<K>' requested here}}
index 9c99ad594458b7aa6b108a7498c1ea0ccc95e294..baae03cf13479ebdd0572390cb4daa1946198199 100644 (file)
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-class Base { // expected-error {{cannot define the implicit default assignment operator for 'class Base'}}
+class Base { // expected-error {{cannot define the implicit default assignment operator for 'Base', because non-static reference member 'ref' can't use default assignment operator}}
   int &ref;  // expected-note {{declared at}}
 };
 
-class X  : Base {  // // expected-error {{cannot define the implicit default assignment operator for 'class X'}}
+class X  : Base {  // // expected-error {{cannot define the implicit default assignment operator for 'X', because non-static const member 'cint' can't use default assignment operator}}
 public:
   X();
   const int cint;  // expected-note {{declared at}}
@@ -70,7 +70,7 @@ void i() {
 
 // Test5
 
-class E1 { // expected-error{{cannot define the implicit default assignment operator for 'class E1', because non-static const member 'a' can't use default assignment operator}}
+class E1 { // expected-error{{cannot define the implicit default assignment operator for 'E1', because non-static const member 'a' can't use default assignment operator}}
 public:
   const int a; // expected-note{{declared at}}
   E1() : a(0) {}  
index 4269991adecfe892570a40f712a2d6dbdc51ba55..b40b133a55412435966a58595f6f34475dd2c35b 100644 (file)
@@ -4,12 +4,11 @@ struct X1 { // has no implicit default constructor
    X1(int);
 };
 
-struct X2  : X1 {  // expected-note {{'struct X2' declared here}} \
-                  //  expected-note {{'struct X2' declared here}}
+struct X2  : X1 {  // expected-note 2 {{'X2' declared here}}
    X2(int);
 };
 
-struct X3 : public X2 { // expected-error {{must explicitly initialize the base class 'struct X2'}}
+struct X3 : public X2 { // expected-error {{implicit default constructor for 'X3' must explicitly initialize the base class 'X2' which does not have a default constructor}}
 };
 X3 x3; // expected-note {{first required here}}
 
index e674260680fca2d7baafbb35df745fde143c77f7..a0999c0c4c62a114b578eb7aa79616e821a9f368 100644 (file)
@@ -91,12 +91,12 @@ public:
   }
 
   void test_Z(const Z& z) {
-    Z z2(z); // expected-error{{no matching constructor for initialization of 'class Z'}}
+    Z z2(z); // expected-error{{no matching constructor for initialization of 'Z'}}
   }
 };
 
 void test_Z(const Z& z) {
-  Z z2(z); // expected-error{{no matching constructor for initialization of 'class Z'}}
+  Z z2(z); // expected-error{{no matching constructor for initialization of 'Z'}}
 }
 
 struct ZZ {
index d9df1bf5b05ac011ff544f7d7d03a35223cd59eb..b3e12960042199124e2620b9be160ada11f21dd7 100644 (file)
@@ -29,7 +29,7 @@ void test() {
   ov(1);
   ov(1.0); // expected-error {{call to deleted function 'ov'}}
 
-  WithDel dd; // expected-error {{call to deleted constructor of 'struct WithDel'}}
+  WithDel dd; // expected-error {{call to deleted constructor of 'WithDel'}}
   WithDel *d = 0;
   d->fn(); // expected-error {{attempt to use a deleted function}}
   int i = *d; // expected-error {{invokes a deleted function}}
index cfcad7989aa237396b39b66cd1e72028e9cb5bfb..9216e5b03798a39a8bcfbefa7d3147affd54b90e 100644 (file)
@@ -6,7 +6,7 @@ class D : public B, public C { };
 
 void f(D* d) {
   A* a;
-  a = d; // expected-error{{ambiguous conversion from derived class 'class D' to base class 'class A'}} expected-error{{incompatible type assigning 'class D *', expected 'class A *'}}
+  a = d; // expected-error{{ambiguous conversion from derived class 'D' to base class 'A':}} expected-error{{incompatible type assigning 'D *', expected 'A *'}}
 }
 
 class Object2 { };
@@ -20,7 +20,7 @@ class F2 : public E2, public A2 { };
 void g(E2* e2, F2* f2) {
   Object2* o2;
   o2 = e2;
-  o2 = f2; // expected-error{{ambiguous conversion from derived class 'class F2' to base class 'class Object2'}} expected-error{{incompatible type assigning 'class F2 *', expected 'class Object2 *'}}
+  o2 = f2; // expected-error{{ambiguous conversion from derived class 'F2' to base class 'Object2':}} expected-error{{incompatible type assigning 'F2 *', expected 'Object2 *'}}
 }
 
 // Test that ambiguous/inaccessibility checking does not trigger too
index ab3c809e00a82dcd3f0b903db480738fd46c65f8..7010d2e0d092be2f29b4bfe83fd96658fdb7e8c7 100644 (file)
@@ -32,7 +32,7 @@ struct E;
 
 typedef E E_typedef;
 struct E {
-  ~E_typedef(); // expected-error{{destructor cannot be declared using a typedef 'E_typedef' (aka 'struct E') of the class name}}
+  ~E_typedef(); // expected-error{{destructor cannot be declared using a typedef 'E_typedef' (aka 'E') of the class name}}
 };
 
 struct F {
index 6601a3dd0d926ad1ef0983f957f498010c3cda43..d30642b5c3ec8270704f71b27d2d7bb6d9e96d1e 100644 (file)
@@ -28,11 +28,11 @@ public:
 void g() {
   X x1(5);
   X x2(1.0, 3, 4.2);
-  X x3(1.0, 1.0); // expected-error{{no matching constructor for initialization of 'class X'}}
+  X x3(1.0, 1.0); // expected-error{{no matching constructor for initialization of 'X'}}
   Y y(1.0);
   X x4(3.14, y);
 
-  Z z; // expected-error{{no matching constructor for initialization of 'class Z'}}
+  Z z; // expected-error{{no matching constructor for initialization of 'Z'}}
 }
 
 struct Base {
@@ -44,7 +44,7 @@ struct Derived : Base {
 };
 
 void foo(const Derived cd, Derived d) {
-        int *pi = cd;  // expected-error {{no viable conversion from 'struct Derived const' to 'int *'}}
+        int *pi = cd;  // expected-error {{no viable conversion from 'Derived const' to 'int *'}}
         int *ppi = d; 
 
 }
index 53d0b9d0189ce345af1dd22f87351a3b25937425..b73e8c57b9f38992090388540d92be7828681615 100644 (file)
@@ -8,7 +8,7 @@ struct D : private A {};
 struct E : A {};
 struct F : B, E {};
 
-struct Incomplete; // expected-note 2 {{forward declaration of 'struct Incomplete'}}
+struct Incomplete; // expected-note 2 {{forward declaration of 'Incomplete'}}
 
 struct Poly
 {
@@ -22,7 +22,7 @@ struct PolyDerived : Poly
 void basic_bad()
 {
   // ptr -> nonptr
-  (void)dynamic_cast<A>((A*)0); // expected-error {{'struct A' is not a reference or pointer}}
+  (void)dynamic_cast<A>((A*)0); // expected-error {{'A' is not a reference or pointer}}
   // nonptr -> ptr
   (void)dynamic_cast<A*>(0); // expected-error {{'int' is not a pointer}}
   // ptr -> noncls
@@ -34,9 +34,9 @@ void basic_bad()
   // noncls -> ref
   (void)dynamic_cast<A&>(*((int*)0)); // expected-error {{'int' is not a class}}
   // ptr -> incomplete
-  (void)dynamic_cast<Incomplete*>((A*)0); // expected-error {{'struct Incomplete' is an incomplete type}}
+  (void)dynamic_cast<Incomplete*>((A*)0); // expected-error {{'Incomplete' is an incomplete type}}
   // incomplete -> ptr
-  (void)dynamic_cast<A*>((Incomplete*)0); // expected-error {{'struct Incomplete' is an incomplete type}}
+  (void)dynamic_cast<A*>((Incomplete*)0); // expected-error {{'Incomplete' is an incomplete type}}
 }
 
 void same()
@@ -57,8 +57,8 @@ void up()
   //(void)dynamic_cast<A&>(*((D*)0));
 
   // Ambiguous
-  (void)dynamic_cast<A*>((F*)0); // expected-error {{ambiguous conversion from derived class 'struct F' to base class 'struct A':\n    struct F -> struct B -> struct A\n    struct F -> struct E -> struct A}}
-  (void)dynamic_cast<A&>(*((F*)0)); // expected-error {{ambiguous conversion from derived class 'struct F' to base class 'struct A':\n    struct F -> struct B -> struct A\n    struct F -> struct E -> struct A}}
+  (void)dynamic_cast<A*>((F*)0); // expected-error {{ambiguous conversion from derived class 'F' to base class 'A':\n    struct F -> struct B -> struct A\n    struct F -> struct E -> struct A}}
+  (void)dynamic_cast<A&>(*((F*)0)); // expected-error {{ambiguous conversion from derived class 'F' to base class 'A':\n    struct F -> struct B -> struct A\n    struct F -> struct E -> struct A}}
 }
 
 void poly()
@@ -69,6 +69,6 @@ void poly()
   (void)dynamic_cast<A&>(*((PolyDerived*)0));
 
   // Not polymorphic source
-  (void)dynamic_cast<Poly*>((A*)0); // expected-error {{'struct A' is not polymorphic}}
-  (void)dynamic_cast<PolyDerived&>(*((A*)0)); // expected-error {{'struct A' is not polymorphic}}
+  (void)dynamic_cast<Poly*>((A*)0); // expected-error {{'A' is not polymorphic}}
+  (void)dynamic_cast<PolyDerived&>(*((A*)0)); // expected-error {{'A' is not polymorphic}}
 }
index 8d2d67f705cdbb545479c44004fa8ddc266c20fd..3cd3a1bc224101ae594ac3f8cd0e134933d943ac 100644 (file)
@@ -27,7 +27,7 @@ namespace NS {
 
 void test_X_elab(NS::X x) {
   struct S4 *s4 = 0;
-  x.test_elab2(s4); // expected-error{{cannot initialize a parameter of type 'struct NS::S4 *' with an lvalue of type 'struct S4 *'}}
+  x.test_elab2(s4); // expected-error{{cannot initialize a parameter of type 'NS::S4 *' with an lvalue of type 'struct S4 *'}}
 }
 
 namespace NS {
index 291b359dfdc4a75112ec49589b01e2de41b7e144..782cf838569fb6f0e585fd089a87e114a4e62fc2 100644 (file)
@@ -29,10 +29,10 @@ struct Incomplete; // expected-note 3 {{forward declaration}}
 // Exception spec must not have incomplete types, or pointers to them, except
 // void.
 void ic1() throw(void); // expected-error {{incomplete type 'void' is not allowed in exception specification}}
-void ic2() throw(Incomplete); // expected-error {{incomplete type 'struct Incomplete' is not allowed in exception specification}}
+void ic2() throw(Incomplete); // expected-error {{incomplete type 'Incomplete' is not allowed in exception specification}}
 void ic3() throw(void*);
-void ic4() throw(Incomplete*); // expected-error {{pointer to incomplete type 'struct Incomplete' is not allowed in exception specification}}
-void ic5() throw(Incomplete&); // expected-error {{reference to incomplete type 'struct Incomplete' is not allowed in exception specification}}
+void ic4() throw(Incomplete*); // expected-error {{pointer to incomplete type 'Incomplete' is not allowed in exception specification}}
+void ic5() throw(Incomplete&); // expected-error {{reference to incomplete type 'Incomplete' is not allowed in exception specification}}
 
 // Redeclarations
 typedef int INT;
index ab37e3c644664edc333fba5997936d013def7c42..2ed4bfe885623ac5ffe7e0be9ab9ca033880ae59 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-struct A; // expected-note 4 {{forward declaration of 'struct A'}}
+struct A; // expected-note 4 {{forward declaration of 'A'}}
 
 struct Abstract { virtual void f() = 0; }; // expected-note {{pure virtual function 'f'}}
 
@@ -11,9 +11,9 @@ void trys() {
     int i; // expected-error {{redefinition of 'i'}}
   } catch(float i) {
   } catch(void v) { // expected-error {{cannot catch incomplete type 'void'}}
-  } catch(A a) { // expected-error {{cannot catch incomplete type 'struct A'}}
-  } catch(A *a) { // expected-warning {{pointer to incomplete type 'struct A'}}
-  } catch(A &a) { // expected-warning {{reference to incomplete type 'struct A'}}
+  } catch(A a) { // expected-error {{cannot catch incomplete type 'A'}}
+  } catch(A *a) { // expected-warning {{ISO C++ forbids catching a pointer to incomplete type 'A'}}
+  } catch(A &a) { // expected-warning {{ISO C++ forbids catching a reference to incomplete type 'A'}}
   } catch(Abstract) { // expected-error {{variable type 'Abstract' is an abstract class}}
   } catch(...) {
     int j = i; // expected-error {{use of undeclared identifier 'i'}}
@@ -29,7 +29,7 @@ void throws() {
   throw;
   throw 0;
   throw throw; // expected-error {{cannot throw object of incomplete type 'void'}}
-  throw (A*)0; // expected-error {{cannot throw pointer to object of incomplete type 'struct A'}}
+  throw (A*)0; // expected-error {{cannot throw pointer to object of incomplete type 'A'}}
 }
 
 void jumps() {
index 0bef0cd6be4c8fda9fe4c6ad7641cc36679e8b3f..4e0486c79ac2aac2b72486ecbe64ff068da583a4 100644 (file)
@@ -175,17 +175,17 @@ void t_529_5_8()
   // Bad code below
 
   typedef C1 *C1p;
-  (void)C1p((A*)0); // expected-error {{cannot cast 'struct A *' to 'C1p' (aka 'struct C1 *') via virtual base 'struct B'}}
+  (void)C1p((A*)0); // expected-error {{cannot cast 'A *' to 'C1p' (aka 'C1 *') via virtual base 'B'}}
   typedef C1 &C1r;
-  (void)C1r(*((A*)0)); // expected-error {{cannot cast 'struct A' to 'C1r' (aka 'struct C1 &') via virtual base 'struct B'}}
+  (void)C1r(*((A*)0)); // expected-error {{cannot cast 'A' to 'C1r' (aka 'C1 &') via virtual base 'B'}}
   typedef D *Dp;
-  (void)Dp((A*)0); // expected-error {{cannot cast 'struct A *' to 'Dp' (aka 'struct D *') via virtual base 'struct B'}}
+  (void)Dp((A*)0); // expected-error {{cannot cast 'A *' to 'Dp' (aka 'D *') via virtual base 'B'}}
   typedef D &Dr;
-  (void)Dr(*((A*)0)); // expected-error {{cannot cast 'struct A' to 'Dr' (aka 'struct D &') via virtual base 'struct B'}}
+  (void)Dr(*((A*)0)); // expected-error {{cannot cast 'A' to 'Dr' (aka 'D &') via virtual base 'B'}}
   typedef H *Hp;
-  (void)Hp((A*)0); // expected-error {{ambiguous cast from base 'struct A' to derived 'struct H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
+  (void)Hp((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
   typedef H &Hr;
-  (void)Hr(*((A*)0)); // expected-error {{ambiguous cast from base 'struct A' to derived 'struct H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
+  (void)Hr(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
 
   // TODO: Test DR427. This requires user-defined conversions, though.
 }
@@ -199,7 +199,7 @@ void t_529_7()
 
   // Bad code below
 
-  (void)Enum((int*)0); // expected-error {{functional-style cast from 'int *' to 'enum Enum' is not allowed}}
+  (void)Enum((int*)0); // expected-error {{functional-style cast from 'int *' to 'Enum' is not allowed}}
 }
 
 // Void pointer to object pointer
@@ -219,8 +219,8 @@ void t_529_9()
   (void)Amp((int B::*)0);
 
   // Bad code below
-  (void)Amp((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'struct H'}}
-  (void)Amp((int F::*)0); // expected-error {{conversion from pointer to member of class 'struct F'}}
+  (void)Amp((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'H' to pointer to member of base class 'A':}}
+  (void)Amp((int F::*)0); // expected-error {{conversion from pointer to member of class 'F' to pointer to member of class 'A' via virtual base 'B' is not allowed}}
 }
 
 // -------- reinterpret_cast -----------
@@ -304,8 +304,8 @@ void memptrs()
   (void)structureimfp(psf);
 
   typedef void (structure::*structurevmfp)();
-  (void)structurevmfp(psi); // expected-error {{functional-style cast from 'int const struct structure::*' to 'structurevmfp' (aka 'void (struct structure::*)()') is not allowed}}
-  (void)structureimp(psf); // expected-error {{functional-style cast from 'void (struct structure::*)()' to 'structureimp' (aka 'int struct structure::*') is not allowed}}
+  (void)structurevmfp(psi); // expected-error {{functional-style cast from 'int const structure::*' to 'structurevmfp' (aka 'void (structure::*)()') is not allowed}}
+  (void)structureimp(psf); // expected-error {{functional-style cast from 'void (structure::*)()' to 'structureimp' (aka 'int structure::*') is not allowed}}
 }
 
 // ---------------- misc ------------------
index be5f91d51ac89ea0a1061b59443cc2fa4bb045a6..3fb0b93fc4f66f58e11d8ba678afc7c5aae91ad0 100644 (file)
@@ -10,10 +10,10 @@ struct B {
 };
 
 struct X {
-   X() { }      // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \
-                // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \
-                // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \
-                // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}}
+   X() { }      // expected-error {{constructor for 'X' must explicitly initialize the reference member 'value'}} \
+                // expected-error {{constructor for 'X' must explicitly initialize the const member 'cvalue'}} \
+                // expected-error {{constructor for 'X' must explicitly initialize the reference member 'b'}} \
+                // expected-error {{constructor for 'X' must explicitly initialize the const member 'cb'}}
    int &value; // expected-note{{declared at}}
    const int cvalue; // expected-note{{declared at}}
    B& b; // expected-note{{declared at}}
index 1bb5adbb861f375ba42ee6e598937566c0a68cf5..cb245011a8735d76f33aa4e4b0423b371586dbc3 100644 (file)
@@ -9,7 +9,7 @@ struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
   void operator delete (void *, int); // expected-note {{'operator delete' declared here}}
 };
 
-void B::f() { // expected-note {{implicit default destructor for 'struct B' first required here}}
+void B::f() { // expected-note {{implicit default destructor for 'B' first required here}}
 }
 
 struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
@@ -17,11 +17,11 @@ struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
   void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
 };
 
-C::C() { }  // expected-note {{implicit default destructor for 'struct C' first required here}}
+C::C() { }  // expected-note {{implicit default destructor for 'C' first required here}}
 
 struct D : A { // expected-error {{no suitable member 'operator delete' in 'D'}}
   void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
-}; // expected-note {{implicit default destructor for 'struct D' first required here}}
+}; // expected-note {{implicit default destructor for 'D' first required here}}
 
 void f() {
   new D; 
index 5bdaf829e64ee1ae6fe833278e71240d674f4453..d627c33d83526ada7c06503915d0beda017e9dd2 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
-struct A; // expected-note 14 {{forward declaration of 'struct A'}}
+struct A; // expected-note 14 {{forward declaration of 'A'}}
 
 A f(); // expected-note {{note: 'f' declared here}}
 
@@ -15,29 +15,29 @@ struct B {
 };
 
 void g() {
-  f(); // expected-error {{calling 'f' with incomplete return type 'struct A'}}
+  f(); // expected-error {{calling 'f' with incomplete return type 'A'}}
 
   typedef A (*Func)();
   Func fp;
-  fp(); // expected-error {{calling function with incomplete return type 'struct A'}}
-  ((Func)0)();  // expected-error {{calling function with incomplete return type 'struct A'}}  
+  fp(); // expected-error {{calling function with incomplete return type 'A'}}
+  ((Func)0)();  // expected-error {{calling function with incomplete return type 'A'}}  
   
   B b;
-  b.f(); // expected-error {{calling 'f' with incomplete return type 'struct A'}}
+  b.f(); // expected-error {{calling 'f' with incomplete return type 'A'}}
   
-  b.operator()(); // expected-error {{calling 'operator()' with incomplete return type 'struct A'}}
-  b.operator A(); // expected-error {{calling 'operator A' with incomplete return type 'struct A'}}
-  b.operator!(); // expected-error {{calling 'operator!' with incomplete return type 'struct A'}}
+  b.operator()(); // expected-error {{calling 'operator()' with incomplete return type 'A'}}
+  b.operator A(); // expected-error {{calling 'operator A' with incomplete return type 'A'}}
+  b.operator!(); // expected-error {{calling 'operator!' with incomplete return type 'A'}}
   
-  !b; // expected-error {{calling 'operator!' with incomplete return type 'struct A'}}
-  b(); // expected-error {{calling 'operator()' with incomplete return type 'struct A'}}
-  b++; // expected-error {{calling 'operator++' with incomplete return type 'struct A'}}
-  b[0]; // expected-error {{calling 'operator[]' with incomplete return type 'struct A'}}
-  b + 1; // expected-error {{calling 'operator+' with incomplete return type 'struct A'}}
-  b->f(); // expected-error {{calling 'operator->' with incomplete return type 'struct A'}}
+  !b; // expected-error {{calling 'operator!' with incomplete return type 'A'}}
+  b(); // expected-error {{calling 'operator()' with incomplete return type 'A'}}
+  b++; // expected-error {{calling 'operator++' with incomplete return type 'A'}}
+  b[0]; // expected-error {{calling 'operator[]' with incomplete return type 'A'}}
+  b + 1; // expected-error {{calling 'operator+' with incomplete return type 'A'}}
+  b->f(); // expected-error {{calling 'operator->' with incomplete return type 'A'}}
   
   A (B::*mfp)() = 0;
-  (b.*mfp)(); // expected-error {{calling function with incomplete return type 'struct A'}}
+  (b.*mfp)(); // expected-error {{calling function with incomplete return type 'A'}}
   
 }
 
index aabed2bff9e7f1860f5e5878c70f4a8564aca23b..a926c812514c598805177347480775ee7c1b50fa 100644 (file)
@@ -10,7 +10,7 @@ class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base
 class C : public B1, private B2 { };
 
 
-class D;                // expected-note {{forward declaration of 'class D'}}
+class D;                // expected-note {{forward declaration of 'D'}}
 
 class E : public D { }; // expected-error{{base class has incomplete type}}
 
@@ -28,5 +28,5 @@ typedef G G_copy;
 typedef G G_copy_2;
 typedef G_copy G_copy_3;
 
-class H : G_copy, A, G_copy_2, // expected-error{{base class 'G_copy' (aka 'class G') specified more than once as a direct base class}}
-          public G_copy_3 { }; // expected-error{{base class 'G_copy' (aka 'class G') specified more than once as a direct base class}}
+class H : G_copy, A, G_copy_2, // expected-error{{base class 'G_copy' (aka 'G') specified more than once as a direct base class}}
+          public G_copy_3 { }; // expected-error{{base class 'G_copy' (aka 'G') specified more than once as a direct base class}}
index 94296e1132f15a815e08031b43d76805d871bda2..01491693deac7b4aa9005b742d0c8fa1801810db 100644 (file)
@@ -35,11 +35,11 @@ struct D : B, C {
 };
 
 void test_lookup(D d) {
-  d.a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'struct A'}}
+  d.a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'A':}}
   (void)d.b; // okay
   d.c; // expected-error{{member 'c' found in multiple base classes of different types}}
   d.d; // expected-error{{member 'd' found in multiple base classes of different types}}
-  d.f(0); // expected-error{{non-static member 'f' found in multiple base-class subobjects of type 'struct A'}}
+  d.f(0); // expected-error{{non-static member 'f' found in multiple base-class subobjects of type 'A':}}
   d.static_f(0); // okay
 
   D::E e = D::enumerator; // okay
@@ -51,11 +51,11 @@ void test_lookup(D d) {
 }
 
 void D::test_lookup() {
-  a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'struct A'}}
+  a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'A':}}
   (void)b; // okay
   c; // expected-error{{member 'c' found in multiple base classes of different types}}
   d; // expected-error{{member 'd' found in multiple base classes of different types}}
-  f(0); // expected-error{{non-static member 'f' found in multiple base-class subobjects of type 'struct A'}}
+  f(0); // expected-error{{non-static member 'f' found in multiple base-class subobjects of type 'A':}}
   static_f(0); // okay
 
   E e = enumerator; // okay
@@ -105,7 +105,7 @@ void test_virtual_lookup(D2 d2, G g) {
 
   D2::E3 e3; // expected-error{{member 'E3' found in multiple base classes of different types}}
 
-  g.a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'struct A'}}
+  g.a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'A':}}
   g.static_f(0); // okay
 }
 
@@ -126,7 +126,7 @@ void D2::test_virtual_lookup() {
 }
 
 void G::test_virtual_lookup() {
-  a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'struct A'}}
+  a; // expected-error{{non-static member 'a' found in multiple base-class subobjects of type 'A':}}
   static_f(0); // okay
 }
 
index d6050cd7337ae82e09ef75bb519d06b2c230702e..92ae92d710ced49606ac599c7fa75ef64588567b 100644 (file)
@@ -34,11 +34,11 @@ void f() {
   pdid = pdi2;
 
   // Fail conversion due to ambiguity and virtuality.
-  int F::*pdif = pdi1; // expected-error {{ambiguous conversion from pointer to member of base class 'struct A' to pointer to member of derived class 'struct F'}}
-  int G::*pdig = pdi1; // expected-error {{conversion from pointer to member of class 'struct A' to pointer to member of class 'struct G' via virtual base 'struct D' is not allowed}}
+  int F::*pdif = pdi1; // expected-error {{ambiguous conversion from pointer to member of base class 'A' to pointer to member of derived class 'F':}}
+  int G::*pdig = pdi1; // expected-error {{conversion from pointer to member of class 'A' to pointer to member of class 'G' via virtual base 'D' is not allowed}}
 
   // Conversion to member of base.
-  pdi1 = pdid; // expected-error {{incompatible type assigning 'int struct D::*', expected 'int struct A::*'}}
+  pdi1 = pdid; // expected-error {{incompatible type assigning 'int D::*', expected 'int A::*'}}
   
   // Comparisons
   int (A::*pf2)(int, int);
@@ -104,8 +104,8 @@ void h() {
   (hm.*pf)();
   (phm->*pf)();
 
-  (void)(hm->*pi); // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct HasMembers'}}
-  (void)(phm.*pi); // expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'struct HasMembers *'}}
+  (void)(hm->*pi); // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'HasMembers'}}
+  (void)(phm.*pi); // expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'HasMembers *'}}
   (void)(i.*pi); // expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'int'}}
   int *ptr;
   (void)(ptr->*pi); // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'int *'}}
@@ -115,8 +115,8 @@ void h() {
   (void)(d.*pai);
   (void)(pd->*pai);
   F f, *ptrf = &f;
-  (void)(f.*pai); // expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'struct F'}}
-  (void)(ptrf->*pai); // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct F *'}}
+  (void)(f.*pai); // expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'F'}}
+  (void)(ptrf->*pai); // expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'F *'}}
 
   (void)(hm.*i); // expected-error {{pointer-to-member}}
   (void)(phm->*i); // expected-error {{pointer-to-member}}
index 9ec17f7b99335e5b2f7d997193d78674c4118902..529ba1023dcde494cb98b0edaeaa78421151c50f 100644 (file)
@@ -9,7 +9,7 @@ namespace A {
 
 void f() {
   A::B::i; // expected-error {{no member named 'i' in namespace 'A::B'}}
-  A::B::C::i; // expected-error {{no member named 'i' in 'class A::B::C'}}
+  A::B::C::i; // expected-error {{no member named 'i' in 'A::B::C'}}
   ::i; // expected-error {{no member named 'i' in the global namespace}}
 }
 
@@ -19,18 +19,18 @@ namespace B {
 
 void g() {
   A::B::D::E; // expected-error {{no member named 'D' in namespace 'A::B'}}
-  B::B::C::D; // expected-error {{no member named 'C' in 'class B::B'}}
+  B::B::C::D; // expected-error {{no member named 'C' in 'B::B'}}
   ::C::D; // expected-error {{no member named 'C' in the global namespace}}
 }
 
 int A::B::i = 10; // expected-error {{no member named 'i' in namespace 'A::B'}}
-int A::B::C::i = 10; // expected-error {{no member named 'i' in 'class A::B::C'}}
-int A::B::S::i = 10; // expected-error {{no member named 'i' in 'struct A::B::S'}}
-int A::B::U::i = 10; // expected-error {{no member named 'i' in 'union A::B::U'}}
+int A::B::C::i = 10; // expected-error {{no member named 'i' in 'A::B::C'}}
+int A::B::S::i = 10; // expected-error {{no member named 'i' in 'A::B::S'}}
+int A::B::U::i = 10; // expected-error {{no member named 'i' in 'A::B::U'}}
 
 using A::B::D; // expected-error {{no member named 'D' in namespace 'A::B'}}
 
 struct S : A::B::C { 
-  using A::B::C::f; // expected-error {{no member named 'f' in 'class A::B::C'}}
+  using A::B::C::f; // expected-error {{no member named 'f' in 'A::B::C'}}
   
 };
index 247e91b2eb398413b36f231d8f56b643309c451b..8657c0dca0aec0824d3f5e063cfc7ee1fc0f097d 100644 (file)
@@ -36,9 +36,9 @@ class C2 {
   int x;
 };
 
-void C2::m() const { } // expected-error{{out-of-line definition of 'm' does not match any declaration in 'class C2'}}
+void C2::m() const { } // expected-error{{out-of-line definition of 'm' does not match any declaration in 'C2'}}
 
-void C2::f(int) { } // expected-error{{out-of-line definition of 'f' does not match any declaration in 'class C2'}}
+void C2::f(int) { } // expected-error{{out-of-line definition of 'f' does not match any declaration in 'C2'}}
 
 void C2::m() {
   x = 0;
@@ -125,7 +125,7 @@ class Operators {
   operator bool();
 };
 
-Operators Operators::operator+(const Operators&) { // expected-error{{out-of-line definition of 'operator+' does not match any declaration in 'class Operators'}}
+Operators Operators::operator+(const Operators&) { // expected-error{{out-of-line definition of 'operator+' does not match any declaration in 'Operators'}}
   Operators ops;
   return ops;
 }
@@ -149,7 +149,7 @@ void A::g(const int&) { } // expected-error{{out-of-line definition of 'g' does
 
 struct Struct { };
 
-void Struct::f() { } // expected-error{{out-of-line definition of 'f' does not match any declaration in 'struct Struct'}}
+void Struct::f() { } // expected-error{{out-of-line definition of 'f' does not match any declaration in 'Struct'}}
 
 void global_func(int);
 void global_func2(int);
@@ -164,8 +164,8 @@ void ::global_func2(int) { } // expected-error{{definition or redeclaration of '
 
 void N::f() { } // okay
 
-struct Y;  // expected-note{{forward declaration of 'struct Y'}}
-Y::foo y; // expected-error{{incomplete type 'struct Y' named in nested name specifier}} \
+struct Y;  // expected-note{{forward declaration of 'Y'}}
+Y::foo y; // expected-error{{incomplete type 'Y' named in nested name specifier}} \
          // expected-error{{no type named 'foo' in}}
 
 X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}} \
@@ -227,6 +227,6 @@ namespace test3 {
   // FIXME: this should really only trigger once
   class A; // expected-note 2 {{forward declaration}}
   void foo(const char *path) {
-    A::execute(path); // expected-error 2 {{incomplete type 'class test3::A' named in nested name specifier}}
+    A::execute(path); // expected-error 2 {{incomplete type 'test3::A' named in nested name specifier}}
   }
 }
index 68323d8d0756a90ce1cd8c98b97fc5b296c03800..ae77e704f5011d99dba84ac6270ed9bd58a0d286 100644 (file)
@@ -8,7 +8,7 @@ struct S // expected-note {{candidate}}
   S(double, int); // expected-note 2 {{candidate}}
   S(float, int); // expected-note 2 {{candidate}}
 };
-struct T; // expected-note{{forward declaration of 'struct T'}}
+struct T; // expected-note{{forward declaration of 'T'}}
 struct U
 {
   // A special new, to verify that the global version isn't used.
@@ -60,15 +60,15 @@ void bad_news(int *ip)
   (void)new int[1][i]; // expected-error {{only the first dimension}}
   (void)new (int[1][i]); // expected-error {{only the first dimension}}
   (void)new (int[i]); // expected-error {{when type is in parentheses}}
-  (void)new int(*(S*)0); // expected-error {{no viable conversion from 'struct S' to 'int'}}
+  (void)new int(*(S*)0); // expected-error {{no viable conversion from 'S' to 'int'}}
   (void)new int(1, 2); // expected-error {{excess elements in scalar initializer}}
   (void)new S(1); // expected-error {{no matching constructor}}
-  (void)new S(1, 1); // expected-error {{call to constructor of 'struct S' is ambiguous}}
+  (void)new S(1, 1); // expected-error {{call to constructor of 'S' is ambiguous}}
   (void)new const int; // expected-error {{default initialization of an object of const type 'int const'}}
   (void)new float*(ip); // expected-error {{cannot initialize a new value of type 'float *' with an lvalue of type 'int *'}}
   // Undefined, but clang should reject it directly.
   (void)new int[-1]; // expected-error {{array size is negative}}
-  (void)new int[*(S*)0]; // expected-error {{array size expression must have integral or enumerated type, not 'struct S'}}
+  (void)new int[*(S*)0]; // expected-error {{array size expression must have integral or enumerated type, not 'S'}}
   (void)::S::new int; // expected-error {{expected unqualified-id}}
   (void)new (0, 0) int; // expected-error {{no matching function for call to 'operator new'}}
   (void)new (0L) int; // expected-error {{call to 'operator new' is ambiguous}}
@@ -114,7 +114,7 @@ struct X2 {
 void test_delete_conv(X0 x0, X1 x1, X2 x2) {
   delete x0; // expected-error{{cannot delete}}
   delete x1;
-  delete x2; // expected-error{{ambiguous conversion of delete expression of type 'struct X2' to a pointer}}
+  delete x2; // expected-error{{ambiguous conversion of delete expression of type 'X2' to a pointer}}
 }
 
 // PR4782
@@ -199,7 +199,7 @@ struct X11 : X10 { // expected-error {{no suitable member 'operator delete' in '
 };
 
 void f() {
-  X11 x11; // expected-note {{implicit default destructor for 'struct X11' first required here}}
+  X11 x11; // expected-note {{implicit default destructor for 'X11' first required here}}
 }
 
 struct X12 {
index f3dc52df49771494483705f871397d96d96f3d73..3283270847fda080a3727906ed7433c261411144 100644 (file)
@@ -10,7 +10,7 @@ struct P {
 };
 
 void f() {
-  int i = __builtin_offsetof(P, fieldThatPointsToANonPODType.m); // expected-warning{{offset of on non-POD type 'struct P'}}
+  int i = __builtin_offsetof(P, fieldThatPointsToANonPODType.m); // expected-warning{{offset of on non-POD type 'P'}}
 }
 
 struct Base { int x; };
index 77d9965ab796253b6e83e7cee27dfa4d3789be3d..8016b116812f3e399bddbbab9473757a92c53c30 100644 (file)
@@ -78,11 +78,11 @@ namespace test1 {
     void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
     void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
 
-    void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'class test1::A const', but method is not marked const}}
-    void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'class test1::A const', but method is not marked const}}
+    void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'test1::A const', but method is not marked const}}
+    void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'test1::A const', but method is not marked const}}
 
-    void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('class test1::A const') would lose const qualifier}}
-    void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'class test1::A const' to 'int' for 1st argument}} 
+    void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('test1::A const') would lose const qualifier}}
+    void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'test1::A const' to 'int' for 1st argument}} 
   };
 
   void test() {
index e07afe20203140791054735ecb09f1ce6c7e48f5..89f181469fdf3112ec72dbe4f8504055959113fa 100644 (file)
@@ -38,7 +38,7 @@ bool operator==(A&, Z&); // expected-note 2{{candidate function}}
 void h(A a, const A ac, Z z) {
   make_A() == z;
   a == z; // expected-error{{use of overloaded operator '==' is ambiguous; candidates are:}}
-  ac == z; // expected-error{{invalid operands to binary expression ('struct A const' and 'struct Z')}}
+  ac == z; // expected-error{{invalid operands to binary expression ('A const' and 'Z')}}
 }
 
 struct B {
@@ -172,7 +172,7 @@ void test_callable(Callable c, Callable2 c2, const Callable2& c2c,
   int &ir = c(1);
   float &fr = c(1, 3.14159, 17, 42);
 
-  c(); // expected-error{{no matching function for call to object of type 'struct Callable'; candidates are:}}
+  c(); // expected-error{{no matching function for call to object of type 'Callable'}}
 
   double &dr = c(1.0f);
 
@@ -200,12 +200,12 @@ struct ConvertToFuncDerived : ConvertToFunc { };
 void test_funcptr_call(ConvertToFunc ctf, ConvertToFuncDerived ctfd) {
   int &i1 = ctf(1.0f, 2.0);
   float &f1 = ctf((short int)1, 1.0f);
-  ctf((long int)17, 2.0); // expected-error{{error: call to object of type 'struct ConvertToFunc' is ambiguous; candidates are:}}
+  ctf((long int)17, 2.0); // expected-error{{call to object of type 'ConvertToFunc' is ambiguous}}
   ctf();
 
   int &i2 = ctfd(1.0f, 2.0);
   float &f2 = ctfd((short int)1, 1.0f);
-  ctfd((long int)17, 2.0); // expected-error{{error: call to object of type 'struct ConvertToFuncDerived' is ambiguous; candidates are:}}
+  ctfd((long int)17, 2.0); // expected-error{{call to object of type 'ConvertToFuncDerived' is ambiguous}}
   ctfd();
 }
 
index 00dc662d0670935ca043cbe85e82248951760f94..54d41b81cab6cd47255f50264db2ca3f4d5319af 100644 (file)
@@ -48,7 +48,7 @@ namespace C
         a.A::sub::x();
         a.A::B::base::x();
 
-        a.bad::x(); // expected-error{{type 'struct bad' is not a direct or virtual base of ''A::sub''}}
+        a.bad::x(); // expected-error{{type 'bad' is not a direct or virtual base of ''A::sub''}}
 
         a->foo();
         a->member::foo();
@@ -69,7 +69,7 @@ namespace C
         a->A::sub::x();
         a->A::B::base::x();
 
-        a->bad::x(); // expected-error{{type 'struct bad' is not a direct or virtual base of ''A::sub''}}
+        a->bad::x(); // expected-error{{type 'bad' is not a direct or virtual base of ''A::sub''}}
 
         (*a)->foo();
         (*a)->member::foo();
index a187d4908cd4d1c981b28da36c2dd1f7a7838895..abde62efceae3bcbae557d5e1cfddde300c8bb5f 100644 (file)
@@ -96,12 +96,12 @@ void test_a() {
   a::a::a::i = 4;
 }
   
-struct Undef { // expected-note{{definition of 'struct Undef' is not complete until the closing '}'}}
+struct Undef { // expected-note{{definition of 'Undef' is not complete until the closing '}'}}
   typedef int type;
 
   Undef::type member;
 
-  static int size = sizeof(Undef); // expected-error{{invalid application of 'sizeof' to an incomplete type 'struct Undef'}}
+  static int size = sizeof(Undef); // expected-error{{invalid application of 'sizeof' to an incomplete type 'Undef'}}
 
   int f();
 };
index 86c10888b8a22f9d4490f9a81ab902f77682847a..c8b5746a39a627f2eb325f72dbe118b7740f28ee 100644 (file)
@@ -16,7 +16,7 @@ namespace foo {
 namespace bar {
   typedef int y;
 
-  struct incomplete; // expected-note{{forward declaration of 'struct bar::incomplete'}}
+  struct incomplete; // expected-note{{forward declaration of 'bar::incomplete'}}
 }
 void test() {
   foo::wibble::x a;
index 976879ecd0ae2a7d41cafb45e553e2324d132e5c..8844162052d9a6c769cab773ddb61cb6d722b9a2 100644 (file)
@@ -14,15 +14,15 @@ struct C : B, A {
 };
 
 void test(C c) {
-  const E2 &e2 = c; // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}}
+  const E2 &e2 = c; // expected-error {{reference initialization of type 'E2 const &' with initializer of type 'C' is ambiguous}}
 }
 
 void foo(const E2 &);
 
 const E2 & re(C c) {
-    foo(c); // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}}
+    foo(c); // expected-error {{reference initialization of type 'E2 const &' with initializer of type 'C' is ambiguous}}
 
-    return c; // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}}
+    return c; // expected-error {{reference initialization of type 'E2 const &' with initializer of type 'C' is ambiguous}}
 }
 
 
index df8337bec82c270165c9dd85f0c301b0846dbf30..f1f4ab9f954115ce27b5af97a9678f8cdd1e8918 100644 (file)
@@ -73,7 +73,7 @@ class Test6 {
 struct C : B, A { };
 
 void test7(C& c) {
-  A& a1 = c; // expected-error {{ambiguous conversion from derived class 'struct C' to base class 'struct A':}}
+  A& a1 = c; // expected-error {{ambiguous conversion from derived class 'C' to base class 'A':}}
 }
 
 // C++ [dcl.ref]p1, C++ [dcl.ref]p4
index f7ab80e67fd0129723bf9c8cc1fd3c1e02d97164..45d41e84601a843358d01a1046b1e5454371fa4e 100644 (file)
@@ -13,7 +13,7 @@ void self_conversion()
   int i = 0;
   (void)reinterpret_cast<int>(i); // expected-error {{reinterpret_cast from 'int' to 'int' is not allowed}}
   structure s;
-  (void)reinterpret_cast<structure>(s); // expected-error {{reinterpret_cast from 'struct structure' to 'struct structure' is not allowed}}
+  (void)reinterpret_cast<structure>(s); // expected-error {{reinterpret_cast from 'structure' to 'structure' is not allowed}}
   int *pi = 0;
   (void)reinterpret_cast<int*>(pi);
 }
@@ -77,18 +77,18 @@ void memptrs()
 {
   const int structure::*psi = 0;
   (void)reinterpret_cast<const float structure::*>(psi);
-  (void)reinterpret_cast<int structure::*>(psi); // expected-error {{reinterpret_cast from 'int const struct structure::*' to 'int struct structure::*' casts away constness}}
+  (void)reinterpret_cast<int structure::*>(psi); // expected-error {{reinterpret_cast from 'int const structure::*' to 'int structure::*' casts away constness}}
 
   void (structure::*psf)() = 0;
   (void)reinterpret_cast<int (structure::*)()>(psf);
 
-  (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error {{reinterpret_cast from 'int const struct structure::*' to 'void (struct structure::*)()' is not allowed}}
-  (void)reinterpret_cast<int structure::*>(psf); // expected-error {{reinterpret_cast from 'void (struct structure::*)()' to 'int struct structure::*' is not allowed}}
+  (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error {{reinterpret_cast from 'int const structure::*' to 'void (structure::*)()' is not allowed}}
+  (void)reinterpret_cast<int structure::*>(psf); // expected-error {{reinterpret_cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
 
   // Cannot cast from integers to member pointers, not even the null pointer
   // literal.
-  (void)reinterpret_cast<void (structure::*)()>(0); // expected-error {{reinterpret_cast from 'int' to 'void (struct structure::*)()' is not allowed}}
-  (void)reinterpret_cast<int structure::*>(0); // expected-error {{reinterpret_cast from 'int' to 'int struct structure::*' is not allowed}}
+  (void)reinterpret_cast<void (structure::*)()>(0); // expected-error {{reinterpret_cast from 'int' to 'void (structure::*)()' is not allowed}}
+  (void)reinterpret_cast<int structure::*>(0); // expected-error {{reinterpret_cast from 'int' to 'int structure::*' is not allowed}}
 }
 
 // PR5545
index 2a7fb25c62a9e10c0948cb5b135d295b4906702f..d5b465f0786ef5779bc5063dd23038b7ea7554c4 100644 (file)
@@ -44,7 +44,7 @@ void f() {
 
   conv_to_not_int_rvalue cnir;
   not_int &&ni4 = cnir; // expected-error {{rvalue reference cannot bind to lvalue}}
-  not_int &ni5 = cnir; // expected-error{{non-const lvalue reference to type 'struct not_int' cannot bind to a value of unrelated type 'struct conv_to_not_int_rvalue'}}
+  not_int &ni5 = cnir; // expected-error{{non-const lvalue reference to type 'not_int' cannot bind to a value of unrelated type 'conv_to_not_int_rvalue'}}
   not_int &&ni6 = conv_to_not_int_rvalue();
 
 
@@ -83,5 +83,5 @@ MoveOnly returningNonEligible() {
   else if (0) // Copy from reference can't be elided
     return r; // expected-error {{call to deleted constructor}}
   else // Construction from different type can't be elided
-    return i; // expected-error {{no viable conversion from 'int' to 'struct MoveOnly'}}
+    return i; // expected-error {{no viable conversion from 'int' to 'MoveOnly'}}
 }
index 62208cd2aeebedc1ba663437a18799e1be87eb14..516243ec70e1113c87d08f68adf5eefae6fae06b 100644 (file)
@@ -18,13 +18,13 @@ template<int N> struct T {
     static_assert(N == 2, "N is not 2!"); // expected-error {{static_assert failed "N is not 2!"}}
 };
 
-T<1> t1; // expected-note {{in instantiation of template class 'struct T<1>' requested here}}
+T<1> t1; // expected-note {{in instantiation of template class 'T<1>' requested here}}
 T<2> t2;
 
 template<typename T> struct S {
     static_assert(sizeof(T) > sizeof(char), "Type not big enough!"); // expected-error {{static_assert failed "Type not big enough!"}}
 };
 
-S<char> s1; // expected-note {{in instantiation of template class 'struct S<char>' requested here}}
+S<char> s1; // expected-note {{in instantiation of template class 'S<char>' requested here}}
 S<int> s2;
 
index 11bf22dfe89992858cc184ffa7ef71bdf2a91065..6d76f813f8d968b9998a2bb444371f09342cd236 100644 (file)
@@ -3,11 +3,11 @@ template<typename T> struct S {
   S(int);
 };
 
-struct T; // expected-note{{forward declaration of 'struct T'}}
+struct T; // expected-note{{forward declaration of 'T'}}
 
 void f() {
   S<int> s0 = static_cast<S<int> >(0);
   S<void*> s1 = static_cast<S<void*> >(00);
 
-  (void)static_cast<T>(10); // expected-error{{'struct T' is an incomplete type}}
+  (void)static_cast<T>(10); // expected-error{{'T' is an incomplete type}}
 }
index efdc276e7d0cbe7926a5cee0e1f65ba706085f2a..2630278d9f6b7ab61f57698b7af904f1300849eb 100644 (file)
@@ -56,10 +56,10 @@ void t_529_2()
   // Bad code below
 
   (void)static_cast<void*>((const int*)0); // expected-error {{static_cast from 'int const *' to 'void *' is not allowed}}
-  (void)static_cast<A*>((E*)0); // expected-error {{private base class 'struct A'}}
+  (void)static_cast<A*>((E*)0); // expected-error {{cannot cast 'E' to its private base class 'A'}}
   (void)static_cast<A*>((H*)0); // expected-error {{ambiguous conversion}}
   (void)static_cast<int>((int*)0); // expected-error {{static_cast from 'int *' to 'int' is not allowed}}
-  (void)static_cast<A**>((B**)0); // expected-error {{static_cast from 'struct B **' to 'struct A **' is not allowed}}
+  (void)static_cast<A**>((B**)0); // expected-error {{static_cast from 'B **' to 'A **' is not allowed}}
   (void)static_cast<char&>(i); // expected-error {{non-const lvalue reference to type 'char' cannot be initialized with a value of type 'int'}}
 }
 
@@ -80,18 +80,18 @@ void t_529_5_8()
 
   // Bad code below
 
-  (void)static_cast<C1*>((A*)0); // expected-error {{cannot cast 'struct A *' to 'struct C1 *' via virtual base 'struct B'}}
-  (void)static_cast<C1&>(*((A*)0)); // expected-error {{cannot cast 'struct A' to 'struct C1 &' via virtual base 'struct B'}}
-  (void)static_cast<D*>((A*)0); // expected-error {{cannot cast 'struct A *' to 'struct D *' via virtual base 'struct B'}}
-  (void)static_cast<D&>(*((A*)0)); // expected-error {{cannot cast 'struct A' to 'struct D &' via virtual base 'struct B'}}
-  (void)static_cast<B*>((const A*)0); // expected-error {{static_cast from 'struct A const *' to 'struct B *' casts away constness}}
-  (void)static_cast<B&>(*((const A*)0)); // expected-error {{static_cast from 'struct A const' to 'struct B &' casts away constness}}
-  (void)static_cast<E*>((A*)0); // expected-error {{cannot cast private base class 'struct A' to 'struct E'}}
-  (void)static_cast<E&>(*((A*)0)); // expected-error {{cannot cast private base class 'struct A' to 'struct E'}}
-  (void)static_cast<H*>((A*)0); // expected-error {{ambiguous cast from base 'struct A' to derived 'struct H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
-  (void)static_cast<H&>(*((A*)0)); // expected-error {{ambiguous cast from base 'struct A' to derived 'struct H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
-  (void)static_cast<E*>((B*)0); // expected-error {{static_cast from 'struct B *' to 'struct E *' is not allowed}}
-  (void)static_cast<E&>(*((B*)0)); // expected-error {{non-const lvalue reference to type 'struct E' cannot be initialized with a value of type 'struct B'}}
+  (void)static_cast<C1*>((A*)0); // expected-error {{cannot cast 'A *' to 'C1 *' via virtual base 'B'}}
+  (void)static_cast<C1&>(*((A*)0)); // expected-error {{cannot cast 'A' to 'C1 &' via virtual base 'B'}}
+  (void)static_cast<D*>((A*)0); // expected-error {{cannot cast 'A *' to 'D *' via virtual base 'B'}}
+  (void)static_cast<D&>(*((A*)0)); // expected-error {{cannot cast 'A' to 'D &' via virtual base 'B'}}
+  (void)static_cast<B*>((const A*)0); // expected-error {{static_cast from 'A const *' to 'B *' casts away constness}}
+  (void)static_cast<B&>(*((const A*)0)); // expected-error {{static_cast from 'A const' to 'B &' casts away constness}}
+  (void)static_cast<E*>((A*)0); // expected-error {{cannot cast private base class 'A' to 'E'}}
+  (void)static_cast<E&>(*((A*)0)); // expected-error {{cannot cast private base class 'A' to 'E'}}
+  (void)static_cast<H*>((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
+  (void)static_cast<H&>(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
+  (void)static_cast<E*>((B*)0); // expected-error {{static_cast from 'B *' to 'E *' is not allowed}}
+  (void)static_cast<E&>(*((B*)0)); // expected-error {{non-const lvalue reference to type 'E' cannot be initialized with a value of type 'B'}}
 
   // TODO: Test inaccessible base in context where it's accessible, i.e.
   // member function and friend.
@@ -108,7 +108,7 @@ void t_529_7()
 
   // Bad code below
 
-  (void)static_cast<Enum>((int*)0); // expected-error {{static_cast from 'int *' to 'enum Enum' is not allowed}}
+  (void)static_cast<Enum>((int*)0); // expected-error {{static_cast from 'int *' to 'Enum' is not allowed}}
 }
 
 // Void pointer to object pointer
@@ -129,8 +129,8 @@ void t_529_9()
   (void)static_cast<int A::*>((int B::*)0);
 
   // Bad code below
-  (void)static_cast<int A::*>((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'struct H'}}
-  (void)static_cast<int A::*>((int F::*)0); // expected-error {{conversion from pointer to member of class 'struct F'}}
+  (void)static_cast<int A::*>((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'H' to pointer to member of base class 'A':}}
+  (void)static_cast<int A::*>((int F::*)0); // expected-error {{conversion from pointer to member of class 'F' to pointer to member of class 'A' via virtual base 'B' is not allowed}}
 }
 
 // PR 5261 - static_cast should instantiate template if possible
@@ -192,6 +192,6 @@ namespace PR6072 {
     (void)static_cast<void (A::*)()>(&B::f);
     (void)static_cast<void (B::*)()>(&B::f);
     (void)static_cast<void (C::*)()>(&B::f);
-    (void)static_cast<void (D::*)()>(&B::f); // expected-error{{static_cast from '<overloaded function type>' to 'void (struct PR6072::D::*)()' is not allowed}}
+    (void)static_cast<void (D::*)()>(&B::f); // expected-error{{static_cast from '<overloaded function type>' to 'void (PR6072::D::*)()' is not allowed}}
   }
 }
index 0ef6917c5911cd2835448b0ba25bca31a5651237..f95982157900f848308faa5367dd43cd3145dc3c 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s 
 
-struct S; // expected-note{{forward declaration of 'struct S'}}
+struct S; // expected-note{{forward declaration of 'S'}}
 
 void f() {
-  __is_pod(S); // expected-error{{incomplete type 'struct S' used in type trait expression}}
+  __is_pod(S); // expected-error{{incomplete type 'S' used in type trait expression}}
 }
index 0d8dc8487bf7199fd8ed48092eb5f9b1be92eadf..c382539e05f1d20e80f5a4ece04a4d788c9402a4 100644 (file)
@@ -11,10 +11,10 @@ struct X {
 };
 
 struct Y; // expected-note{{previous definition is here}}
-typedef int Y;  // expected-error{{typedef redefinition with different types ('int' vs 'struct Y')}}
+typedef int Y;  // expected-error{{typedef redefinition with different types ('int' vs 'Y')}}
 
 typedef int Y2; // expected-note{{previous definition is here}}
-struct Y2; // expected-error{{definition of type 'struct Y2' conflicts with typedef of the same name}}
+struct Y2; // expected-error{{definition of type 'Y2' conflicts with typedef of the same name}}
 
 void f(); // expected-note{{previous definition is here}}
 typedef int f; // expected-error{{redefinition of 'f' as different kind of symbol}}
index 7960cac783103435919b34401441182d4018a6b1..0e78ff46a65c69c3681cf7378edff6c0bc02950b 100644 (file)
@@ -18,7 +18,7 @@ void g()
 struct X; // expected-note 3{{forward declaration}}
 
 void g1(X &x) {
-  (void)typeid(X); // expected-error{{'typeid' of incomplete type 'struct X'}}
-  (void)typeid(X&); // expected-error{{'typeid' of incomplete type 'struct X'}}
-  (void)typeid(x); // expected-error{{'typeid' of incomplete type 'struct X'}}
+  (void)typeid(X); // expected-error{{'typeid' of incomplete type 'X'}}
+  (void)typeid(X&); // expected-error{{'typeid' of incomplete type 'X'}}
+  (void)typeid(x); // expected-error{{'typeid' of incomplete type 'X'}}
 }
index 084a81104d5501d52e05d5b6a25230a3a5b2e43b..5f8d8caae698bc3e8a8d8fcccc58c375f681166f 100644 (file)
@@ -9,10 +9,10 @@ namespace N {
 }
 using namespace N;
 
-foo::bar x; // expected-error{{no type named 'bar' in 'struct N::Wibble'}}
+foo::bar x; // expected-error{{no type named 'bar' in 'N::Wibble'}}
 
 void f() {
-  foo::bar  = 4; // expected-error{{no member named 'bar' in 'struct N::Wibble'}}
+  foo::bar  = 4; // expected-error{{no member named 'bar' in 'N::Wibble'}}
 }
 
 template<typename T>
index 8f2876ce4b32ac8823ccb11ac6de38ae26b6c901..5148ed5bcc7152356645386bff815c9d5dfc407a 100644 (file)
@@ -13,7 +13,7 @@ template<typename T> struct B : A<T> {
   using A<double>::f; // expected-error{{using declaration refers into 'A<double>::', which is not a base class of 'B<int>'}}
 };
 
-B<int> a; // expected-note{{in instantiation of template class 'struct B<int>' requested here}}
+B<int> a; // expected-note{{in instantiation of template class 'B<int>' requested here}}
 
 template<typename T> struct C : A<T> {
   using A<T>::f;
index d6a86c4c8cb5b88d049128b2bfd1454a3683d41b..16a7a1d0c9b975621be8ca70526f87bf17f9966f 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
 
-struct A { // expected-error {{implicit default constructor for 'struct A' must explicitly initialize the const member 'i'}}
+struct A { // expected-error {{implicit default constructor for 'A' must explicitly initialize the const member 'i'}}
      const int i;      // expected-note {{declared at}}
      virtual void f() { } 
 };
index 5f95446d41f2510a3ef2e39ffecb52d0cce670e4..d31f1f7196aa52a3ee996dad69d0549293127dd0 100644 (file)
@@ -15,7 +15,7 @@ void t1()
 {
   C c(10);
   
-  g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}}
+  g(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
   g(10, version);
 }
 
@@ -23,10 +23,10 @@ void t2()
 {
   C c(10);
 
-  c.g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
+  c.g(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
   c.g(10, version);
   
-  C::h(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}}
+  C::h(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
   C::h(10, version);
 }
 
@@ -36,7 +36,7 @@ void t3()
 {
   C c(10);
   
-  block(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic block; call will abort at runtime}}
+  block(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic block; call will abort at runtime}}
   block(10, version);
 }
 
@@ -51,7 +51,7 @@ void t4()
 
   D d;
   
-  d(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
+  d(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
   d(10, version);
 }
 
@@ -63,8 +63,8 @@ void t5()
 {
   C c(10);
   
-  E e(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime}}
-  (void)E(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime}}
+  E e(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic constructor; call will abort at runtime}}
+  (void)E(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic constructor; call will abort at runtime}}
 }
 
 // PR5761: unevaluated operands and the non-POD warning
@@ -85,6 +85,6 @@ Base &get_base(...);
 int eat_base(...);
 
 void test_typeid(Base &base) {
-  (void)typeid(get_base(base)); // expected-warning{{cannot pass object of non-POD type 'struct Base' through variadic function; call will abort at runtime}}
+  (void)typeid(get_base(base)); // expected-warning{{cannot pass object of non-POD type 'Base' through variadic function; call will abort at runtime}}
   (void)typeid(eat_base(base)); // okay
 }
index 6ee619ef064788bd9d6917cbb31a6033acd26d98..4bb58084397354545d6e26766585cf0c7da4d290 100644 (file)
@@ -22,10 +22,10 @@ void f() {
   (void)reinterpret_cast<__v2si>(ll);
   (void)(__v2si)(ll);
 
-  (void)reinterpret_cast<S>(v2si); // expected-error {{reinterpret_cast from '__v2si' to 'struct S' is not allowed}}
-  (void)(S)v2si; // expected-error {{C-style cast from '__v2si' to 'struct S' is not allowed}}
-  (void)reinterpret_cast<__v2si>(s); // expected-error {{reinterpret_cast from 'struct S' to '__v2si' is not allowed}}
-  (void)(__v2si)s; // expected-error {{C-style cast from 'struct S' to '__v2si' is not allowed}}
+  (void)reinterpret_cast<S>(v2si); // expected-error {{reinterpret_cast from '__v2si' to 'S' is not allowed}}
+  (void)(S)v2si; // expected-error {{C-style cast from '__v2si' to 'S' is not allowed}}
+  (void)reinterpret_cast<__v2si>(s); // expected-error {{reinterpret_cast from 'S' to '__v2si' is not allowed}}
+  (void)(__v2si)s; // expected-error {{C-style cast from 'S' to '__v2si' is not allowed}}
   
   (void)reinterpret_cast<unsigned char>(v2si); // expected-error {{reinterpret_cast from vector '__v2si' to scalar 'unsigned char' of different size}}
   (void)(unsigned char)v2si; // expected-error {{C-style cast from vector '__v2si' to scalar 'unsigned char' of different size}}
index 2e21fb7365e9e961c6df6bd374fe1ce26d131f2e..97164d93affc78c35ab7d53bc09f89795c8a6f51 100644 (file)
@@ -6,11 +6,11 @@ struct A {
 struct B : A {  // expected-error {{no suitable member 'operator delete' in 'B'}}
   B() { }
   void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
-}; // expected-note {{implicit default destructor for 'struct B' first required here}}
+}; // expected-note {{implicit default destructor for 'B' first required here}}
 
 struct C : A {  // expected-error {{no suitable member 'operator delete' in 'C'}}
   void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
-}; // expected-note {{implicit default destructor for 'struct C' first required here}}
+}; // expected-note {{implicit default destructor for 'C' first required here}}
 
 void f() {
   (void)new B;
index 09cbfadf9b37dabd861300191c64ed831a0bf844..688713582657415ff80d49a3f331901a48055666 100644 (file)
@@ -21,7 +21,7 @@ class A {
 };
 
 class B : A {
-  virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('struct T2::b *' is not derived from 'struct T2::a *')}}
+  virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('T2::b *' is not derived from 'T2::a *')}}
 };
 
 }
@@ -36,7 +36,7 @@ class A {
 };
 
 class B : A {
-  virtual b* f(); // expected-error{{invalid covariant return for virtual function: 'struct T3::a' is a private base class of 'struct T3::b'}}
+  virtual b* f(); // expected-error{{invalid covariant return for virtual function: 'T3::a' is a private base class of 'T3::b'}}
 };
 
 }
@@ -52,7 +52,7 @@ class A {
 };
 
 class B : A {
-  virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides (ambiguous conversion from derived class 'struct T4::b' to base class 'struct T4::a':\n\
+  virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides (ambiguous conversion from derived class 'T4::b' to base class 'T4::a':\n\
     struct T4::b -> struct T4::a\n\
     struct T4::b -> struct T4::a1 -> struct T4::a)}}
 };
@@ -70,7 +70,7 @@ class A {
 
 class B : A {
   virtual a* const f(); 
-  virtual a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides ('struct T5::a *' has different qualifiers than 'struct T5::a *const')}}
+  virtual a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides ('T5::a *' has different qualifiers than 'T5::a *const')}}
 };
 
 }
@@ -86,7 +86,7 @@ class A {
 
 class B : A {
   virtual a* f(); 
-  virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'struct T6::a const *' is more qualified than class type 'struct T6::a *'}}
+  virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'T6::a const *' is more qualified than class type 'T6::a *'}}
 };
 
 }
@@ -106,14 +106,14 @@ namespace T7 {
 
 namespace T8 {
   struct a { };
-  struct b; // expected-note {{forward declaration of 'struct T8::b'}}
+  struct b; // expected-note {{forward declaration of 'T8::b'}}
   
   class A {
     virtual a *f();
   };
   
   class B : A {
-    b* f(); // expected-error {{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('struct T8::b' is incomplete)}}
+    b* f(); // expected-error {{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('T8::b' is incomplete)}}
   };
 }
 
@@ -129,7 +129,7 @@ namespace T9 {
   };
   
   class B : A {
-    virtual b<int> *f(); // expected-note {{in instantiation of template class 'struct T9::b<int>' requested here}}
+    virtual b<int> *f(); // expected-note {{in instantiation of template class 'T9::b<int>' requested here}}
   };
 }
 
@@ -230,7 +230,7 @@ namespace type_dependent_covariance {
   };
   template <int N, int M> struct X1 : X<N> {
     virtual TD<M>* f1(); // expected-error{{return type of virtual function 'f1' is not covariant with the return type of the function it overrides ('TD<1> *'}}
-    virtual D* f2(); // expected-error{{return type of virtual function 'f2' is not covariant with the return type of the function it overrides ('struct type_dependent_covariance::D *' is not derived from 'TB<1> *')}}
+    virtual D* f2(); // expected-error{{return type of virtual function 'f2' is not covariant with the return type of the function it overrides ('type_dependent_covariance::D *' is not derived from 'TB<1> *')}}
   };
 
   X1<0, 0> good;
@@ -260,7 +260,7 @@ namespace T11 {
   };
 
   struct D : C {
-    virtual B&& f(); // expected-error {{virtual function 'f' has a different return type ('struct T11::B &&') than the function it overrides (which has return type 'struct T11::A &')}}
+    virtual B&& f(); // expected-error {{virtual function 'f' has a different return type ('T11::B &&') than the function it overrides (which has return type 'T11::A &')}}
   };
 };
 
@@ -273,6 +273,6 @@ namespace T12 {
   };
 
   struct D : C {
-    virtual B& f(); // expected-error {{virtual function 'f' has a different return type ('struct T12::B &') than the function it overrides (which has return type 'struct T12::A &&')}}
+    virtual B& f(); // expected-error {{virtual function 'f' has a different return type ('T12::B &') than the function it overrides (which has return type 'T12::A &&')}}
   };
 };
index 35b32b26a066907f2e8b2c42b58e471652052848..2634202172a2b8624a18453ed799e11286cf3083 100644 (file)
@@ -9,9 +9,9 @@ public:
   complex() : s2(1),  // expected-warning {{member 's2' will be initialized after}}
               s1(1) , // expected-note {{field s1}} 
               s3(3),  // expected-warning {{member 's3' will be initialized after}} 
-              BB1(),   // expected-note {{base 'struct BB1'}}  \
-                      // expected-warning {{base class 'struct BB1' will be initialized after}}
-              BB() {}  // expected-note {{base 'struct BB'}}
+              BB1(),   // expected-note {{base 'BB1'}}  \
+                      // expected-warning {{base class 'BB1' will be initialized after}}
+              BB() {}  // expected-note {{base 'BB'}}
   int s1;
   int s2;
   int s3;
@@ -44,14 +44,14 @@ struct C : public A, public B, private virtual V {
 
 
 struct D : public A, public B { 
-  D()  : A(), V() {   } // expected-warning {{base class 'struct A' will be initialized after}} \
-                        // expected-note {{base 'struct V'}}
+  D()  : A(), V() {   } // expected-warning {{base class 'A' will be initialized after}} \
+                        // expected-note {{base 'V'}}
 };
 
 
 struct E : public A, public B, private virtual V { 
-  E()  : A(), V() {  } // expected-warning {{base class 'struct A' will be initialized after}} \
-                       // expected-note {{base 'struct V'}}
+  E()  : A(), V() {  } // expected-warning {{base class 'A' will be initialized after}} \
+                       // expected-note {{base 'V'}}
 };
 
 
@@ -64,13 +64,13 @@ struct B1 {
 };
 
 struct F : public A1, public B1, private virtual V { 
-  F()  : A1(), V() {  } // expected-warning {{base class 'struct A1' will be initialized after}} \
-                        // expected-note {{base 'struct V'}}
+  F()  : A1(), V() {  } // expected-warning {{base class 'A1' will be initialized after}} \
+                        // expected-note {{base 'V'}}
 };
 
 struct X : public virtual A, virtual V, public virtual B {
-  X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \
-                        // expected-note {{base 'struct V'}}
+  X(): A(), V(), B() {} // expected-warning {{base class 'A' will be initialized after}} \
+                        // expected-note {{base 'V'}}
 };
 
 class Anon {
index 4a211e3197041cafccc0ea39127e94a744184db5..c4b176c975ee2078b54e1aee08c3592930a7e98e 100644 (file)
@@ -18,7 +18,7 @@ void test1(X x) {
 
   I<P> *ip = (I<P>*)cft;
 
-  (id)x; // expected-error {{C-style cast from 'struct X' to 'id' is not allowed}}
+  (id)x; // expected-error {{C-style cast from 'X' to 'id' is not allowed}}
 
   id *pid = (id*)ccct;
 
index 6ced8e426bc556cb90cddafb76eb64e854ef4ece..7e5c4c6c97a0ad49122b5a16ca241ba9046048c0 100644 (file)
@@ -17,7 +17,7 @@ void t1(D *d)
 {
   C c(10);
 
-  [d g:10, c]; // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
+  [d g:10, c]; // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
   [d g:10, version];
 }
 
index c492a365880cd1c7726d6ce13070e93a718648a2..d09f52476b312d42638d4ccdf2c518eb90a76dcd 100644 (file)
@@ -4,7 +4,7 @@ namespace N {
 
   template<> class A<int> { };
 
-  template<> class A<float>; // expected-note{{forward declaration of 'class N::A<float>'}}
+  template<> class A<float>; // expected-note{{forward declaration of 'N::A<float>'}}
 
   class B : public A<int> { };
 }
index efb00c7f3d2547d10b8c1e83b35f8c833b4391a0..c65802e5c86937786589a435600ca4ade642d3bd 100644 (file)
@@ -20,7 +20,7 @@ int test_incomplete_specs(A<double, double> *a1,
                           A<double> *a2)
 {
   (void)a1->x; // expected-error{{member access into incomplete type}}
-  (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}}
+  (void)a2->x; // expected-error{{implicit instantiation of undefined template 'A<double, int>'}}
 }
 
 typedef float FLOAT;
index 3da43fa675022e7ffac225448dee0eb93b38cf9a..d2cc45b0352b2e23d11032c0cb2d94df13fbb520 100644 (file)
@@ -11,17 +11,17 @@ template<typename T> void f1(T a, T b = 10) { } // expected-error{{no viable con
 
 template<typename T> void f2(T a, T b = T()) { }
 
-template<typename T> void f3(T a, T b = T() + T()); // expected-error{{invalid operands to binary expression ('struct S' and 'struct S')}}
+template<typename T> void f3(T a, T b = T() + T()); // expected-error{{invalid operands to binary expression ('S' and 'S')}}
 
 void g() {
   f1(10);
-  f1(S()); // expected-note{{in instantiation of default function argument expression for 'f1<struct S>' required here}}
+  f1(S()); // expected-note{{in instantiation of default function argument expression for 'f1<S>' required here}}
   
   f2(10);
   f2(S());
   
   f3(10);
-  f3(S()); // expected-note{{in instantiation of default function argument expression for 'f3<struct S>' required here}}
+  f3(S()); // expected-note{{in instantiation of default function argument expression for 'f3<S>' required here}}
 }
 
 template<typename T> struct F {
@@ -38,10 +38,10 @@ void g2() {
 
 void g3(F<int> f, F<struct S> s) {
   f.f();
-  s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}}
+  s.f(); // expected-note{{in instantiation of default function argument expression for 'f<S>' required here}}
   
   F<int> f2;
-  F<S> s2; // expected-note{{in instantiation of default function argument expression for 'F<struct S>' required here}}
+  F<S> s2; // expected-note{{in instantiation of default function argument expression for 'F<S>' required here}}
 }
 
 template<typename T> struct G {
index 08d4de542c6dd47797a7511c6830d399fc9fa4d9..600115b5653063cdf2d48f88379e5ba67565764a 100644 (file)
@@ -32,7 +32,7 @@ namespace PR6031 {
   template <class TT>
   struct FI2
   {
-    C<typename FI2::type> a; // expected-error{{no type named 'type' in 'struct PR6031::FI2'}} \
+    C<typename FI2::type> a; // expected-error{{no type named 'type' in 'FI2<TT>'}} \
         // expected-error{{C++ requires a type specifier for all declarations}}
   };
 
@@ -58,7 +58,7 @@ namespace PR6031 {
       class NoDepBase::Nested nested; // expected-error{{'Nested' does not name a tag member in the specified scope}}
       typedef typename NoDepBase::template MemberTemplate<T>::type type; // expected-error{{'MemberTemplate' following the 'template' keyword does not refer to a template}} \
       // FIXME: expected-error{{unqualified-id}}
-      return NoDepBase::a; // expected-error{{no member named 'a' in 'struct PR6031::NoDepBase'}}
+      return NoDepBase::a; // expected-error{{no member named 'a' in 'NoDepBase<T>'}}
     }
   };
 }
index 0e2debf22b99e578320e6b88ebf689b6bd290ac6..3973102b92e7bd28b39cd6a6a5ccd54357c92b55 100644 (file)
@@ -20,7 +20,7 @@ int test_make2() {
 
 template<typename T, unsigned Length> 
 struct make3 { 
-  typedef T __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type 'struct s'}}
+  typedef T __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type 's'}}
 };
 
 struct s {};
index 97d3dc30c56c484c7b38f4bba8f18b0d9ac531cf..9669b2035a1fef3b2514e8f5339ce05e5c281974 100644 (file)
@@ -23,7 +23,7 @@ struct Constructible {
 template<typename T, typename U>
 struct CStyleCast0 {
   void f(T t) {
-    (void)((U)t); // expected-error{{C-style cast from 'struct A' to 'int'}}
+    (void)((U)t); // expected-error{{C-style cast from 'A' to 'int' is not allowed}}
   }
 };
 
@@ -36,7 +36,7 @@ template struct CStyleCast0<A, int>; // expected-note{{instantiation}}
 template<typename T, typename U>
 struct StaticCast0 {
   void f(T t) {
-    (void)static_cast<U>(t); // expected-error{{static_cast from 'int' to 'struct A' is not allowed}}
+    (void)static_cast<U>(t); // expected-error{{static_cast from 'int' to 'A' is not allowed}}
   }
 };
 
@@ -89,7 +89,7 @@ template struct ConstCast0<int const *, float *>; // expected-note{{instantiatio
 template<typename T, typename U>
 struct FunctionalCast1 {
   void f(T t) {
-    (void)U(t); // expected-error{{functional-style cast from 'struct A' to 'int'}}
+    (void)U(t); // expected-error{{functional-style cast from 'A' to 'int' is not allowed}}
   }
 };
 
index 0ae13b972829134fa870ebf2c2ce8d79ca85f275..82cc320fd3c45f44e7a856116c431e314a4359d0 100644 (file)
@@ -17,12 +17,12 @@ struct X {
 X<int> f() { return 0; }
 
 struct XField {
-  X<float(int)> xf; // expected-note{{in instantiation of template class 'struct X<float (int)>' requested here}}
+  X<float(int)> xf; // expected-note{{in instantiation of template class 'X<float (int)>' requested here}}
 };
 
 void test_subscript(X<double> *ptr1, X<int(int)> *ptr2, int i) {
   (void)ptr1[i];
-  (void)ptr2[i]; // expected-note{{in instantiation of template class 'struct X<int (int)>' requested here}}
+  (void)ptr2[i]; // expected-note{{in instantiation of template class 'X<int (int)>' requested here}}
 }
 
 void test_arith(X<signed char> *ptr1, X<unsigned char> *ptr2,
@@ -30,13 +30,13 @@ void test_arith(X<signed char> *ptr1, X<unsigned char> *ptr2,
   (void)(ptr1 + 5);
   // FIXME: if I drop the ')' after void, below, it still parses (!)
   (void)(5 + ptr2);
-  (void)(ptr3 + 5); // expected-note{{in instantiation of template class 'struct X<char (char)>' requested here}}
-  (void)(5 + ptr4); // expected-note{{in instantiation of template class 'struct X<short (short)>' requested here}}
+  (void)(ptr3 + 5); // expected-note{{in instantiation of template class 'X<char (char)>' requested here}}
+  (void)(5 + ptr4); // expected-note{{in instantiation of template class 'X<short (short)>' requested here}}
 }
 
 void test_new() {
   (void)new X<float>(0);
-  (void)new X<float(float)>; // expected-note{{in instantiation of template class 'struct X<float (float)>' requested here}}
+  (void)new X<float(float)>; // expected-note{{in instantiation of template class 'X<float (float)>' requested here}}
 }
 
 void test_memptr(X<long> *p1, long X<long>::*pm1,
index c418fe16e87fdf11ef6dab03bcf06b1b19f0c145..d4f12df22ec2115f1ad32e65d4e5d39204b525b5 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
 // FIXME: the "note" should be down at the call site!
-template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'struct Incomplete' is not allowed in exception specification}} \
+template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'Incomplete' is not allowed in exception specification}} \
                          // expected-note{{instantiation of}}
 struct Incomplete; // expected-note{{forward}}
 
index 37145b63b616287976fec70e5a9d691a254d413c..7af59fd2d11b68768c5ec492807a8b91cc2a2770 100644 (file)
@@ -7,7 +7,7 @@ struct Bitfields {
 
 void test_Bitfields(Bitfields<0, 5> *b) {
   (void)sizeof(Bitfields<10, 5>);
-  (void)sizeof(Bitfields<0, 1>); // expected-note{{in instantiation of template class 'struct Bitfields<0, 1>' requested here}}
+  (void)sizeof(Bitfields<0, 1>); // expected-note{{in instantiation of template class 'Bitfields<0, 1>' requested here}}
 }
 
 template<int I, int J>
@@ -17,7 +17,7 @@ struct BitfieldPlus {
 
 void test_BitfieldPlus() {
   (void)sizeof(BitfieldPlus<0, 1>);
-  (void)sizeof(BitfieldPlus<-5, 5>); // expected-note{{in instantiation of template class 'struct BitfieldPlus<-5, 5>' requested here}}
+  (void)sizeof(BitfieldPlus<-5, 5>); // expected-note{{in instantiation of template class 'BitfieldPlus<-5, 5>' requested here}}
 }
 
 template<int I, int J>
@@ -28,8 +28,8 @@ struct BitfieldMinus {
 
 void test_BitfieldMinus() {
   (void)sizeof(BitfieldMinus<5, 1>);
-  (void)sizeof(BitfieldMinus<0, 1>); // expected-note{{in instantiation of template class 'struct BitfieldMinus<0, 1>' requested here}}
-  (void)sizeof(BitfieldMinus<5, 5>); // expected-note{{in instantiation of template class 'struct BitfieldMinus<5, 5>' requested here}}
+  (void)sizeof(BitfieldMinus<0, 1>); // expected-note{{in instantiation of template class 'BitfieldMinus<0, 1>' requested here}}
+  (void)sizeof(BitfieldMinus<5, 5>); // expected-note{{in instantiation of template class 'BitfieldMinus<5, 5>' requested here}}
 }
 
 template<int I, int J>
@@ -40,7 +40,7 @@ struct BitfieldDivide {
 
 void test_BitfieldDivide() {
   (void)sizeof(BitfieldDivide<5, 1>);
-  (void)sizeof(BitfieldDivide<5, 0>); // expected-note{{in instantiation of template class 'struct BitfieldDivide<5, 0>' requested here}}
+  (void)sizeof(BitfieldDivide<5, 0>); // expected-note{{in instantiation of template class 'BitfieldDivide<5, 0>' requested here}}
 }
 
 template<typename T, T I, int J>
@@ -64,9 +64,9 @@ struct BitfieldNeg2 {
 
 void test_BitfieldNeg() {
   (void)sizeof(BitfieldNeg<-5>); // okay
-  (void)sizeof(BitfieldNeg<5>); // expected-note{{in instantiation of template class 'struct BitfieldNeg<5>' requested here}}
+  (void)sizeof(BitfieldNeg<5>); // expected-note{{in instantiation of template class 'BitfieldNeg<5>' requested here}}
   (void)sizeof(BitfieldNeg2<int, -5>); // okay
-  (void)sizeof(BitfieldNeg2<int, 5>); // expected-note{{in instantiation of template class 'struct BitfieldNeg2<int, 5>' requested here}}
+  (void)sizeof(BitfieldNeg2<int, 5>); // expected-note{{in instantiation of template class 'BitfieldNeg2<int, 5>' requested here}}
 }
 
 template<typename T>
index c5eb3cc53e7a26a17da14b0670adee0be15e6a3a..92915c7daf17411b672adcde0db4013a32ca6f5b 100644 (file)
@@ -153,7 +153,7 @@ struct TypeId0 {
     if (ptr)
       return typeid(ptr);
     else
-      return typeid(T); // expected-error{{'typeid' of incomplete type 'struct Incomplete'}}
+      return typeid(T); // expected-error{{'typeid' of incomplete type 'Incomplete'}}
   }
 };
 
index d166e7e78e6a5c4702259c0a705bb89182123110..60d4b21cac9ed84d4f758c880d361fcb36aaa53e 100644 (file)
@@ -20,9 +20,9 @@ void test1(const X<int> *xi) {
 }
 
 void test2(const X<float> *xf) {
-  (void)xf->x; // expected-note{{in instantiation of template class 'struct X<float>' requested here}}
+  (void)xf->x; // expected-note{{in instantiation of template class 'X<float>' requested here}}
 }
 
 void test3(const X<int(int)> *xf) {
-  (void)xf->x; // expected-note{{in instantiation of template class 'struct X<int (int)>' requested here}}
+  (void)xf->x; // expected-note{{in instantiation of template class 'X<int (int)>' requested here}}
 }
index 742abcc569c2be4d968cccb195c23bf05ce6d6fa..5d69b50a760680ccb5fade8b1ae1d441c1b4a5ac 100644 (file)
@@ -28,14 +28,14 @@ void test_instantiation(X<double>::C *x,
                         X<float>::D::F *f) {
   double &dr = x->foo();
   float &fr = e->bar();
-  f->foo(); // expected-error{{implicit instantiation of undefined member 'struct X<float>::D::F'}}
+  f->foo(); // expected-error{{implicit instantiation of undefined member 'X<float>::D::F'}}
   
 }
 
 
 X<void>::C *c3; // okay
 X<void>::D::E *e1; // okay
-X<void>::D::E e2; // expected-note{{in instantiation of member class 'struct X<void>::D::E' requested here}}
+X<void>::D::E e2; // expected-note{{in instantiation of member class 'X<void>::D::E' requested here}}
 
 // Redeclarations.
 namespace test1 {
index 324363ce96dca888d295a276b13f195b9ed21d24..f3a60679d17604f8cdfdf3e3896cbb1fc4fcec12 100644 (file)
@@ -16,14 +16,14 @@ public:
 
  template <typename CHECKER>
  void registerCheck(CHECKER *check) {
-   Checkers.push_back(S<void *>()); // expected-note {{in instantiation of member function 'vector<struct S<void *> >::push_back' requested here}}
+   Checkers.push_back(S<void *>()); // expected-note {{in instantiation of member function 'vector<S<void *> >::push_back' requested here}}
  }
 };
 
 class RetainReleaseChecker { };
 
 void f(GRExprEngine& Eng) {
-   Eng.registerCheck(new RetainReleaseChecker); // expected-note {{in instantiation of function template specialization 'GRExprEngine::registerCheck<class RetainReleaseChecker>' requested here}}
+   Eng.registerCheck(new RetainReleaseChecker); // expected-note {{in instantiation of function template specialization 'GRExprEngine::registerCheck<RetainReleaseChecker>' requested here}}
 }
 
 // PR 5838
@@ -43,7 +43,7 @@ namespace test1 {
     int a;
     template<typename T> struct B : A<T> {
       void f() {
-        a = 0; // expected-error {{type 'struct test1::O' is not a direct or virtual base of ''B<int>''}}
+        a = 0; // expected-error {{type 'test1::O' is not a direct or virtual base of ''B<int>''}}
       }
     };
   };
index a02fe5238c35706a79d3a9ea9e7e189e9586a577..357ea2617759863ca048a5d45f83c8b4c5432548 100644 (file)
@@ -20,7 +20,7 @@ void test(X<int> *xi, int *ip, X<int(int)> *xf) {
 }
 
 void test_bad() {
-  X<void> xv; // expected-note{{in instantiation of template class 'class X<void>' requested here}}
+  X<void> xv; // expected-note{{in instantiation of template class 'X<void>' requested here}}
 }
 
 template<typename T, typename U>
@@ -36,7 +36,7 @@ void test_ovl(Overloading<int, long> *oil, int i, long l) {
 }
 
 void test_ovl_bad() {
-  Overloading<float, float> off; // expected-note{{in instantiation of template class 'class Overloading<float, float>' requested here}}
+  Overloading<float, float> off; // expected-note{{in instantiation of template class 'Overloading<float, float>' requested here}}
 }
 
 template<typename T>
index fda2b9ea306b4bdd17ceabbfde3b2928146ecd4e..e90ac5223d989279d06d40a582f1d715d9b917aa 100644 (file)
@@ -6,7 +6,7 @@ public:
 };
 
 int array1[X<int, 2>::value == 5? 1 : -1];
-X<int, 0> xi0; // expected-note{{in instantiation of template class 'class X<int, 0>' requested here}}
+X<int, 0> xi0; // expected-note{{in instantiation of template class 'X<int, 0>' requested here}}
 
 
 template<typename T>
@@ -14,7 +14,7 @@ class Y {
   static const T value = 0; // expected-error{{'value' can only be initialized if it is a static const integral data member}}
 };
 
-Y<float> fy; // expected-note{{in instantiation of template class 'class Y<float>' requested here}}
+Y<float> fy; // expected-note{{in instantiation of template class 'Y<float>' requested here}}
 
 
 // out-of-line static member variables
index 977fd08cc36ddca9498c23e71f7bb64199b8edd7..bb168a1c932ecab9ccd498a17a2d146f31389113 100644 (file)
@@ -11,6 +11,6 @@ add_pointer<float>::type test2(int * ptr) {
   return ptr; // expected-error{{cannot initialize return object of type 'add_pointer<float>::type' (aka 'float *') with an lvalue of type 'int *'}}
 }
 
-add_pointer<int&>::type // expected-note{{in instantiation of template class 'struct add_pointer<int &>' requested here}} \
-// expected-error {{no type named 'type' in 'struct add_pointer<int &>'}}
+add_pointer<int&>::type // expected-note{{in instantiation of template class 'add_pointer<int &>' requested here}} \
+// expected-error {{no type named 'type' in 'add_pointer<int &>'}}
 test3(); 
index 93f9a3552aa04cdcada5763ef33f1d5b27eacf76..21456e902ae5535cf496f5a672a75e17ca759585 100644 (file)
@@ -2,7 +2,7 @@
 template<typename T> struct A; // expected-note 4{{template is declared here}}
 
 template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}} \
-// expected-error{{implicit instantiation of undefined template 'struct A<X *>'}}
+// expected-error{{implicit instantiation of undefined template 'A<X *>'}}
 
 template<typename T> struct C : B<T> { } ; // expected-note{{instantiation of template class}}
 
@@ -19,14 +19,14 @@ void f() {
 typedef struct { } X;
 
 void g() {
-  (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}}
+  (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'B<X>' requested here}}
 }
 
 template<typename T> 
-struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'struct A<int>'}}
-  A<T*> // expected-error{{implicit instantiation of undefined template 'struct A<int *>'}}
+struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'A<int>'}}
+  A<T*> // expected-error{{implicit instantiation of undefined template 'A<int *>'}}
   { };
 
 void h() {
-  (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'struct G<int>' requested here}}
+  (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'G<int>' requested here}}
 }
index 391589e250450075f770704457c12355aacf55df..6f5a660d99f1147a7494fd5342ed51f6975ff8b5 100644 (file)
@@ -36,7 +36,7 @@ typedef int& int_ref_t;
 Def2<int_ref_t> *d2; // expected-note{{in instantiation of default argument for 'Def2<int &>' required here}}
 
 
-template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'struct Def1<int const>'}}
+template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1<int const>'}}
 
 template<typename T, typename T2 = T&> struct Def3;
 
index bb3c88ad3957e4c5a78bd0479b653982d3e28547..3a7408e280259e22da81773394a44ca677ab9909 100644 (file)
@@ -22,7 +22,7 @@ struct bogus {
 
 template<typename MetaFun, typename T>
 struct apply1 {
-  typedef typename MetaFun::template apply<T>::type type; // expected-note{{in instantiation of template class 'struct add_reference::apply<void>' requested here}} \
+  typedef typename MetaFun::template apply<T>::type type; // expected-note{{in instantiation of template class 'add_reference::apply<void>' requested here}} \
   // expected-error{{'apply' following the 'template' keyword does not refer to a template}}
 };
 
@@ -32,9 +32,9 @@ apply1<add_reference, int>::type ir = i;
 apply1<add_reference, float>::type fr = i; // expected-error{{non-const lvalue reference to type 'float' cannot bind to a value of unrelated type 'int'}}
 
 void test() {
-  apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'struct apply1<struct add_reference, void>' requested here}}
+  apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'apply1<add_reference, void>' requested here}}
 
-  apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'struct apply1<struct bogus, int>' requested here}}
+  apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'apply1<bogus, int>' requested here}}
 }
 
 
index fdfd4e47b240343268da05d04c94b43dc9c915f8..9c20f2a0eb1ecef11faa66897c8e9dbd5633bcea 100644 (file)
@@ -16,7 +16,7 @@ enum E { Enumerator = 17 };
 A<E> *a5; // expected-error{{template argument for non-type template parameter must be an expression}}
 template<E Value> struct A1; // expected-note{{template parameter is declared here}}
 A1<Enumerator> *a6; // okay
-A1<17> *a7; // expected-error{{non-type template argument of type 'int' cannot be converted to a value of type 'enum E'}}
+A1<17> *a7; // expected-error{{non-type template argument of type 'int' cannot be converted to a value of type 'E'}}
 
 const long LongValue = 12345678;
 A<LongValue> *a8;
@@ -32,7 +32,7 @@ public:
   X(int, int);
   operator int() const;
 };
-A<X(17, 42)> *a11; // expected-error{{non-type template argument of type 'class X' must have an integral or enumeration type}}
+A<X(17, 42)> *a11; // expected-error{{non-type template argument of type 'X' must have an integral or enumeration type}}
 
 float f(float);
 
@@ -59,8 +59,8 @@ volatile X * X_volatile_ptr;
 template<X const &AnX> struct A4; // expected-note 2{{template parameter is declared here}}
 X an_X;
 A4<an_X> *a15_1; // okay
-A4<*X_volatile_ptr> *a15_2; // expected-error{{reference binding of non-type template parameter of type 'class X const &' to template argument of type 'class X volatile' ignores qualifiers}}
-A4<y> *15_3; //  expected-error{{non-type template parameter of reference type 'class X const &' cannot bind to template argument of type 'struct Y'}} \
+A4<*X_volatile_ptr> *a15_2; // expected-error{{reference binding of non-type template parameter of type 'X const &' to template argument of type 'X volatile' ignores qualifiers}}
+A4<y> *15_3; //  expected-error{{non-type template parameter of reference type 'X const &' cannot bind to template argument of type 'struct Y'}} \
             // FIXME: expected-error{{expected unqualified-id}}
 
 template<int (&fr)(int)> struct A5; // expected-note 2{{template parameter is declared here}}
@@ -83,14 +83,14 @@ struct Z {
 template<int (Z::*pmf)(int)> struct A6; // expected-note{{template parameter is declared here}}
 A6<&Z::foo> *a17_1;
 A6<&Z::bar> *a17_2;
-A6<&Z::baz> *a17_3; // expected-error{{non-type template argument of type 'double (struct Z::*)(double)' cannot be converted to a value of type 'int (struct Z::*)(int)'}}
+A6<&Z::baz> *a17_3; // expected-error{{non-type template argument of type 'double (Z::*)(double)' cannot be converted to a value of type 'int (Z::*)(int)'}}
 
 
 template<int Z::*pm> struct A7;  // expected-note{{template parameter is declared here}}
 template<int Z::*pm> struct A7c;
 A7<&Z::int_member> *a18_1;
 A7c<&Z::int_member> *a18_2;
-A7<&Z::float_member> *a18_3; // expected-error{{non-type template argument of type 'float struct Z::*' cannot be converted to a value of type 'int struct Z::*'}}
+A7<&Z::float_member> *a18_3; // expected-error{{non-type template argument of type 'float Z::*' cannot be converted to a value of type 'int Z::*'}}
 A7c<(&Z::int_member)> *a18_3; // expected-error{{non-type template argument cannot be surrounded by parentheses}}
 
 template<unsigned char C> struct Overflow; // expected-note{{template parameter is declared here}}
index a376900666d89b49e3cf1fab87215754ab060a8f..a1db3f8057acaac5007a73b3a8ec22d08b891461 100644 (file)
@@ -14,7 +14,7 @@ A<A<int> > *a6;
 // [temp.arg.type]p2
 void f() {
   class X { };
-  A<X> * a = 0; // expected-error{{template argument uses local type 'class X'}}
+  A<X> * a = 0; // expected-error{{template argument uses local type 'X'}}
 }
 
 struct { int x; } Unnamed; // expected-note{{unnamed type used in template argument was declared here}}
index b968ea6ad54410142e8bb9e425b0a9a9484b2c15..42766a0620b8c8217657a37ea8edc670f80e6952 100644 (file)
@@ -16,7 +16,7 @@ namespace N {
 int i;
 
 typename N::A::type *ip1 = &i;
-typename N::B::type *ip2 = &i; // expected-error{{no type named 'type' in 'struct N::B'}}
+typename N::B::type *ip2 = &i; // expected-error{{no type named 'type' in 'N::B'}}
 typename N::C::type *ip3 = &i; // expected-error{{typename specifier refers to non-type member 'type'}}
 
 void test(double d) {
@@ -33,8 +33,8 @@ void test(double d) {
 namespace N {
   template<typename T>
   struct X {
-    typedef typename T::type type; // expected-error {{no type named 'type' in 'struct N::B'}} \
-    // expected-error {{no type named 'type' in 'struct B'}} \
+    typedef typename T::type type; // expected-error {{no type named 'type' in 'N::B'}} \
+    // expected-error {{no type named 'type' in 'B'}} \
     // FIXME: location info for error above isn't very good \
     // expected-error 2{{typename specifier refers to non-type member 'type'}} \
     // expected-error{{type 'int' cannot be used prior to '::' because it has no members}}
@@ -42,18 +42,18 @@ namespace N {
 }
 
 N::X<N::A>::type *ip4 = &i;
-N::X<N::B>::type *ip5 = &i; // expected-note{{in instantiation of template class 'struct N::X<struct N::B>' requested here}} \
+N::X<N::B>::type *ip5 = &i; // expected-note{{in instantiation of template class 'N::X<N::B>' requested here}} \
 // expected-error{{no type named 'type' in}}
-N::X<N::C>::type *ip6 = &i; // expected-note{{in instantiation of template class 'struct N::X<struct N::C>' requested here}} \
+N::X<N::C>::type *ip6 = &i; // expected-note{{in instantiation of template class 'N::X<N::C>' requested here}} \
 // expected-error{{no type named 'type' in}}
 
-N::X<int>::type fail1; // expected-note{{in instantiation of template class 'struct N::X<int>' requested here}} \
+N::X<int>::type fail1; // expected-note{{in instantiation of template class 'N::X<int>' requested here}} \
 // expected-error{{no type named 'type' in}}
 
 template<typename T>
 struct Y {
-  typedef typename N::X<T>::type *type; // expected-note{{in instantiation of template class 'struct N::X<struct B>' requested here}} \
-  // expected-note{{in instantiation of template class 'struct N::X<struct C>' requested here}}
+  typedef typename N::X<T>::type *type; // expected-note{{in instantiation of template class 'N::X<B>' requested here}} \
+  // expected-note{{in instantiation of template class 'N::X<C>' requested here}}
 };
 
 struct A {
@@ -69,7 +69,7 @@ struct C {
 };
 
 ::Y<A>::type ip7 = &i;
-::Y<B>::type ip8 = &i; // expected-note{{in instantiation of template class 'struct Y<struct B>' requested here}} \
+::Y<B>::type ip8 = &i; // expected-note{{in instantiation of template class 'Y<B>' requested here}} \
 // expected-error{{no type named 'type' in}}
-::Y<C>::type ip9 = &i; // expected-note{{in instantiation of template class 'struct Y<struct C>' requested here}} \
+::Y<C>::type ip9 = &i; // expected-note{{in instantiation of template class 'Y<C>' requested here}} \
 // expected-error{{no type named 'type' in}}