]> granicus.if.org Git - clang/commitdiff
Make all the 'redefinition' diagnostics more consistent, and make the
authorChris Lattner <sabre@nondot.org>
Sun, 23 Nov 2008 23:12:31 +0000 (23:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Nov 2008 23:12:31 +0000 (23:12 +0000)
"previously defined here" diagnostics all notes.

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

39 files changed:
include/clang/Basic/DiagnosticKinds.def
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaStmt.cpp
test/Parser/argument_redef.c
test/Sema/array-declared-as-incorrect-type.c
test/Sema/enum.c
test/Sema/function.c
test/Sema/implicit-decl.c
test/Sema/merge-decls.c
test/Sema/predefined-function.c
test/Sema/redefinition.c
test/Sema/struct-compat.c
test/Sema/switch-duplicate-defaults.c [deleted file]
test/Sema/switch.c
test/Sema/tentative-decls.c
test/Sema/typedef-redef.c
test/SemaCXX/class-names.cpp
test/SemaCXX/condition.cpp
test/SemaCXX/constructor.cpp
test/SemaCXX/conversion-function.cpp
test/SemaCXX/decl-expr-ambiguity.cpp
test/SemaCXX/default1.cpp
test/SemaCXX/destructor.cpp
test/SemaCXX/fntype-decl.cpp
test/SemaCXX/namespace.cpp
test/SemaCXX/overload-decl.cpp
test/SemaCXX/typedef-redecl.cpp
test/SemaObjC/DoubleMethod.m
test/SemaObjC/alias-test-1.m
test/SemaObjC/alias-test-2.m
test/SemaObjC/check-dup-decl-methods-1.m
test/SemaObjC/check-dup-objc-decls-1.m
test/SemaObjC/class-conforming-protocol-1.m
test/SemaObjC/class-def-test-1.m
test/SemaObjC/class-impl-1.m
test/SemaObjC/conflicting-ivar-test-1.m
test/SemaObjC/ivar-sem-check-1.m

index cbf7590058eaaddbb5f45795c7197ae739a5811c..c3000f19bd5af80a97768862846052f54ad7a6e5 100644 (file)
 
 DIAG(note_previous_definition, NOTE,
      "previous definition is here")
+DIAG(note_previous_declaration, NOTE,
+     "previous declaration is here")
+DIAG(note_previous_implicit_declaration, NOTE,
+     "previous implicit declaration is here")
+DIAG(note_previous_use, NOTE,
+     "previous use is here")
+DIAG(note_duplicate_case_prev, NOTE,
+     "previous case defined here")
 
 
 //===----------------------------------------------------------------------===//
@@ -484,12 +492,8 @@ DIAG(warn_using_decl, WARNING,
      "using")
 DIAG(warn_also_found_decl, WARNING,
      "also found")
-DIAG(error_duplicate_method_decl, ERROR,
+DIAG(err_duplicate_method_decl, ERROR,
      "duplicate declaration of method '%0'")
-DIAG(err_previous_declaration, ERROR,
-     "previous declaration is here")
-DIAG(err_previous_implicit_declaration, ERROR,
-     "previous implicit declaration is here")
 DIAG(err_undeclared_protocol, ERROR,
      "cannot find protocol declaration for %0")
 DIAG(err_missing_sel_definition, ERROR,
@@ -877,12 +881,6 @@ DIAG(err_param_default_argument_references_this, ERROR,
 DIAG(err_param_default_argument_nonfunc, ERROR,
      "default arguments can only be specified for parameters in a function"
      " declaration")
-DIAG(err_previous_definition, ERROR,
-     "previous definition is here")
-DIAG(err_previous_use, ERROR,
-     "previous use is here")
-DIAG(err_first_label, ERROR,
-    "first label is here")
 
 // C++ Overloading Semantic Analysis.
 DIAG(err_ovl_diff_return_type, ERROR,
@@ -1491,8 +1489,6 @@ DIAG(warn_case_value_overflow, WARNING,
      "overflow converting case value to switch condition type (%0 to %1)")
 DIAG(err_duplicate_case, ERROR,
      "duplicate case value '%0'")
-DIAG(err_duplicate_case_prev, ERROR,
-     "previous case value occurrence defined here")
 DIAG(warn_case_empty_range, WARNING,
      "empty case range specified")
 DIAG(err_typecheck_statement_requires_scalar, ERROR,
index c3b130255b319bceea507b96aef3905fc3dc3c1d..8ffafadd3e945d80b1c4d84a970a3227000b986e 100644 (file)
@@ -326,7 +326,7 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
   if (!Old) {
     Diag(New->getLocation(), diag::err_redefinition_different_kind)
       << New->getDeclName();
-    Diag(OldD->getLocation(), diag::err_previous_definition);
+    Diag(OldD->getLocation(), diag::note_previous_definition);
     return New;
   }
   
@@ -338,7 +338,7 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
     Diag(New->getLocation(), diag::err_redefinition_different_typedef)
       << New->getUnderlyingType().getAsString()
       << Old->getUnderlyingType().getAsString();
-    Diag(Old->getLocation(), diag::err_previous_definition);
+    Diag(Old->getLocation(), diag::note_previous_definition);
     return Old;
   }
   
@@ -365,7 +365,7 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
   }
 
   Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName();
-  Diag(Old->getLocation(), diag::err_previous_definition);
+  Diag(Old->getLocation(), diag::note_previous_definition);
   return New;
 }
 
@@ -419,7 +419,7 @@ Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD, bool &Redeclaration) {
   if (!Old) {
     Diag(New->getLocation(), diag::err_redefinition_different_kind)
       << New->getDeclName();
-    Diag(OldD->getLocation(), diag::err_previous_definition);
+    Diag(OldD->getLocation(), diag::note_previous_definition);
     return New;
   }
 
@@ -427,11 +427,11 @@ Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD, bool &Redeclaration) {
   // implicit declaration, or a declaration.
   diag::kind PrevDiag;
   if (Old->isThisDeclarationADefinition())
-    PrevDiag = diag::err_previous_definition;
+    PrevDiag = diag::note_previous_definition;
   else if (Old->isImplicit())
-    PrevDiag = diag::err_previous_implicit_declaration;
+    PrevDiag = diag::note_previous_implicit_declaration;
   else 
-    PrevDiag = diag::err_previous_declaration;
+    PrevDiag = diag::note_previous_declaration;
   
   QualType OldQType = Context.getCanonicalType(Old->getType());
   QualType NewQType = Context.getCanonicalType(New->getType());
@@ -538,7 +538,7 @@ void Sema::CheckForFileScopedRedefinitions(Scope *S, VarDecl *VD) {
           VD->getStorageClass() != VarDecl::Extern &&
           VD->getStorageClass() != VarDecl::PrivateExtern) {
         Diag(VD->getLocation(), diag::err_redefinition) << VD->getDeclName();
-        Diag(OldDecl->getLocation(), diag::err_previous_definition);
+        Diag(OldDecl->getLocation(), diag::note_previous_definition);
       }
     }
   }
@@ -558,7 +558,7 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) {
   if (!Old) {
     Diag(New->getLocation(), diag::err_redefinition_different_kind)
       << New->getDeclName();
-    Diag(OldD->getLocation(), diag::err_previous_definition);
+    Diag(OldD->getLocation(), diag::note_previous_definition);
     return New;
   }
 
@@ -569,7 +569,7 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) {
   QualType NewCType = Context.getCanonicalType(New->getType());
   if (OldCType != NewCType && !Context.typesAreCompatible(OldCType, NewCType)) {
     Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName();
-    Diag(Old->getLocation(), diag::err_previous_definition);
+    Diag(Old->getLocation(), diag::note_previous_definition);
     return New;
   }
   // C99 6.2.2p4: Check if we have a static decl followed by a non-static.
@@ -577,20 +577,20 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) {
       (Old->getStorageClass() == VarDecl::None ||
        Old->getStorageClass() == VarDecl::Extern)) {
     Diag(New->getLocation(), diag::err_static_non_static) << New->getName();
-    Diag(Old->getLocation(), diag::err_previous_definition);
+    Diag(Old->getLocation(), diag::note_previous_definition);
     return New;
   }
   // C99 6.2.2p4: Check if we have a non-static decl followed by a static.
   if (New->getStorageClass() != VarDecl::Static &&
       Old->getStorageClass() == VarDecl::Static) {
     Diag(New->getLocation(), diag::err_non_static_static) << New->getName();
-    Diag(Old->getLocation(), diag::err_previous_definition);
+    Diag(Old->getLocation(), diag::note_previous_definition);
     return New;
   }
   // Variables with external linkage are analyzed in FinalizeDeclaratorGroup.
   if (New->getStorageClass() != VarDecl::Extern && !New->isFileVarDecl()) {
     Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName();
-    Diag(Old->getLocation(), diag::err_previous_definition);
+    Diag(Old->getLocation(), diag::note_previous_definition);
   }
   return New;
 }
@@ -2076,7 +2076,7 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) {
   const FunctionDecl *Definition;
   if (FD->getBody(Definition)) {
     Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName();
-    Diag(Definition->getLocation(), diag::err_previous_definition);
+    Diag(Definition->getLocation(), diag::note_previous_definition);
   }
 
   PushDeclContext(FD);
@@ -2257,7 +2257,7 @@ Sema::DeclTy *Sema::ActOnTag(Scope *S, unsigned TagType, TagKind TK,
         // struct or something similar.
         if (PrevTagDecl->getTagKind() != Kind) {
           Diag(KWLoc, diag::err_use_with_wrong_tag) << Name;
-          Diag(PrevDecl->getLocation(), diag::err_previous_use);
+          Diag(PrevDecl->getLocation(), diag::note_previous_use);
           // Recover by making this an anonymous redefinition.
           Name = 0;
           PrevDecl = 0;
@@ -2269,7 +2269,7 @@ Sema::DeclTy *Sema::ActOnTag(Scope *S, unsigned TagType, TagKind TK,
           // Diagnose attempts to redefine a tag.
           if (PrevTagDecl->isDefinition()) {
             Diag(NameLoc, diag::err_redefinition) << Name;
-            Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+            Diag(PrevDecl->getLocation(), diag::note_previous_definition);
             // If this is a redefinition, recover by making this struct be
             // anonymous, which will make any later references get the previous
             // definition.
@@ -2291,7 +2291,7 @@ Sema::DeclTy *Sema::ActOnTag(Scope *S, unsigned TagType, TagKind TK,
         // The tag name clashes with a namespace name, issue an error and
         // recover by making this tag be anonymous.
         Diag(NameLoc, diag::err_redefinition_different_kind) << Name;
-        Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+        Diag(PrevDecl->getLocation(), diag::note_previous_definition);
         Name = 0;
       }
     }
@@ -2394,7 +2394,7 @@ Sema::DeclTy *Sema::ActOnTagStruct(Scope *S, TagDecl::TagKind Kind, TagKind TK,
         // struct or something similar.
         if (PrevTagDecl->getTagKind() != Kind) {
           Diag(KWLoc, diag::err_use_with_wrong_tag) << Name;
-          Diag(PrevDecl->getLocation(), diag::err_previous_use);
+          Diag(PrevDecl->getLocation(), diag::note_previous_use);
           // Recover by making this an anonymous redefinition.
           Name = 0;
           PrevDecl = 0;
@@ -2414,7 +2414,7 @@ Sema::DeclTy *Sema::ActOnTagStruct(Scope *S, TagDecl::TagKind Kind, TagKind TK,
             if (RecordDecl* DefRecord =
                 cast<RecordDecl>(PrevTagDecl)->getDefinition(Context)) {
               Diag(NameLoc, diag::err_redefinition) << Name;
-              Diag(DefRecord->getLocation(), diag::err_previous_definition);
+              Diag(DefRecord->getLocation(), diag::note_previous_definition);
               // If this is a redefinition, recover by making this struct be
               // anonymous, which will make any later references get the previous
               // definition.
@@ -2441,7 +2441,7 @@ Sema::DeclTy *Sema::ActOnTagStruct(Scope *S, TagDecl::TagKind Kind, TagKind TK,
         // The tag name clashes with a namespace name, issue an error and
         // recover by making this tag be anonymous.
         Diag(NameLoc, diag::err_redefinition_different_kind) << Name;
-        Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+        Diag(PrevDecl->getLocation(), diag::note_previous_definition);
         Name = 0;
       }
     }
@@ -2717,7 +2717,7 @@ void Sema::ActOnFields(Scope* S,
       // outer S.
       Diag(DefRecord->getLocation(), diag::err_nested_redefinition)
         << DefRecord->getKindName();
-      Diag(RecLoc, diag::err_previous_definition);
+      Diag(RecLoc, diag::note_previous_definition);
       Record->setInvalidDecl();
       return;
     }
@@ -2822,7 +2822,7 @@ void Sema::ActOnFields(Scope* S,
             break;
           }
         }
-        Diag(PrevLoc, diag::err_previous_definition);
+        Diag(PrevLoc, diag::note_previous_definition);
         FD->setInvalidDecl();
         EnclosingDecl->setInvalidDecl();
         continue;
@@ -2880,7 +2880,7 @@ Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,
         Diag(IdLoc, diag::err_redefinition_of_enumerator) << Id;
       else
         Diag(IdLoc, diag::err_redefinition) << Id;
-      Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+      Diag(PrevDecl->getLocation(), diag::note_previous_definition);
       delete Val;
       return 0;
     }
@@ -2943,7 +2943,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX,
     //     E0 = sizeof(enum e0 { E1 })
     //   };
     Diag(Enum->getLocation(), diag::err_nested_redefinition) << Enum->getName();
-    Diag(EnumLoc, diag::err_previous_definition);
+    Diag(EnumLoc, diag::note_previous_definition);
     Enum->setInvalidDecl();
     return;
   }
index a92ad9582e0382527f0cb3f5758fc526e410df09..d9f3bc652e81e7015d59659284fcba7865cafd8f 100644 (file)
@@ -197,7 +197,7 @@ Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old) {
       Diag(NewParam->getLocation(), 
            diag::err_param_default_argument_redefinition)
         << NewParam->getDefaultArg()->getSourceRange();
-      Diag(OldParam->getLocation(), diag::err_previous_definition);
+      Diag(OldParam->getLocation(), diag::note_previous_definition);
     } else if (OldParam->getDefaultArg()) {
       // Merge the old default argument into the new parameter
       NewParam->setDefaultArg(OldParam->getDefaultArg());
@@ -1112,7 +1112,7 @@ Sema::DeclTy *Sema::ActOnConstructorDeclarator(CXXConstructorDecl *ConDecl) {
   if (!IsOverload(ConDecl, ClassDecl->getConstructors(), MatchedDecl)) {
     Diag(ConDecl->getLocation(), diag::err_constructor_redeclared)
       << SourceRange(ConDecl->getLocation());
-    Diag((*MatchedDecl)->getLocation(), diag::err_previous_declaration)
+    Diag((*MatchedDecl)->getLocation(), diag::note_previous_declaration)
       << SourceRange((*MatchedDecl)->getLocation());
     ConDecl->setInvalidDecl();
     return ConDecl;
@@ -1157,9 +1157,9 @@ Sema::DeclTy *Sema::ActOnDestructorDeclarator(CXXDestructorDecl *Destructor) {
   if (CXXDestructorDecl *PrevDestructor = ClassDecl->getDestructor()) {
     Diag(Destructor->getLocation(), diag::err_destructor_redeclared);
     Diag(PrevDestructor->getLocation(),
-         PrevDestructor->isThisDeclarationADefinition()?
-             diag::err_previous_definition
-           : diag::err_previous_declaration);
+         PrevDestructor->isThisDeclarationADefinition() ?
+             diag::note_previous_definition
+           : diag::note_previous_declaration);
     Destructor->setInvalidDecl();
     return Destructor;
   }
@@ -1188,8 +1188,8 @@ Sema::DeclTy *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) {
       Diag(Conversion->getLocation(), diag::err_conv_function_redeclared);
       Diag(OtherConv->getLocation(),
            OtherConv->isThisDeclarationADefinition()?
-              diag::err_previous_definition
-            : diag::err_previous_declaration);
+              diag::note_previous_definition
+            : diag::note_previous_declaration);
       Conversion->setInvalidDecl();
       return (DeclTy *)Conversion;      
     }
@@ -1272,7 +1272,7 @@ Sema::DeclTy *Sema::ActOnStartNamespaceDef(Scope *NamespcScope,
         // This is an invalid name redefinition.
         Diag(Namespc->getLocation(), diag::err_redefinition_different_kind)
           << Namespc->getDeclName();
-        Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+        Diag(PrevDecl->getLocation(), diag::note_previous_definition);
         Namespc->setInvalidDecl();
         // Continue on to push Namespc as current DeclContext and return it.
       }
index c030a370e40de5fd18ddc5dd3e676b678de93c8e..7a7b3767b896db14968641d15b5fbf1367d56a82 100644 (file)
@@ -68,7 +68,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
   Decl *PrevDecl = LookupDecl(ClassName, Decl::IDNS_Ordinary, TUScope);
   if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
     Diag(ClassLoc, diag::err_redefinition_different_kind) << ClassName;
-    Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+    Diag(PrevDecl->getLocation(), diag::note_previous_definition);
   }
   
   ObjCInterfaceDecl* IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
@@ -102,7 +102,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
     PrevDecl = LookupDecl(SuperName, Decl::IDNS_Ordinary, TUScope);
     if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
       Diag(SuperLoc, diag::err_redefinition_different_kind) << SuperName;
-      Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+      Diag(PrevDecl->getLocation(), diag::note_previous_definition);
     }
     else {
       // Check that super class is previously defined
@@ -149,7 +149,7 @@ Sema::DeclTy *Sema::ActOnCompatiblityAlias(SourceLocation AtLoc,
     }
     else {
       Diag(AliasLocation, diag::err_conflicting_aliasing_type) << AliasName;
-      Diag(ADecl->getLocation(), diag::err_previous_declaration);
+      Diag(ADecl->getLocation(), diag::note_previous_declaration);
     }
     return 0;
   }
@@ -458,7 +458,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
   Decl *PrevDecl = LookupDecl(ClassName, Decl::IDNS_Ordinary, TUScope);
   if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
     Diag(ClassLoc, diag::err_redefinition_different_kind) << ClassName;
-    Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+    Diag(PrevDecl->getLocation(), diag::note_previous_definition);
   }
   else {
     // Is there an interface declaration of this class; if not, warn!
@@ -475,7 +475,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
     if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
       Diag(SuperClassLoc, diag::err_redefinition_different_kind)
         << SuperClassname;
-      Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+      Diag(PrevDecl->getLocation(), diag::note_previous_definition);
     } else {
       SDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl); 
       if (!SDecl)
@@ -486,7 +486,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
         // super class.
         Diag(SuperClassLoc, diag::err_conflicting_super_class)
           << SDecl->getDeclName();
-        Diag(SDecl->getLocation(), diag::err_previous_definition);
+        Diag(SDecl->getLocation(), diag::note_previous_definition);
       }
     }
   }
@@ -559,14 +559,14 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
       Diag(ImplIvar->getLocation(), diag::err_conflicting_ivar_type)
         << ImplIvar->getIdentifier()
         << ImplIvar->getType() << ClsIvar->getType();
-      Diag(ClsIvar->getLocation(), diag::err_previous_definition);
+      Diag(ClsIvar->getLocation(), diag::note_previous_definition);
     }
     // TODO: Two mismatched (unequal width) Ivar bitfields should be diagnosed 
     // as error.
     else if (ImplIvar->getIdentifier() != ClsIvar->getIdentifier()) {
       Diag(ImplIvar->getLocation(), diag::err_conflicting_ivar_name)
         << ImplIvar->getIdentifier() << ClsIvar->getIdentifier();
-      Diag(ClsIvar->getLocation(), diag::err_previous_definition);
+      Diag(ClsIvar->getLocation(), diag::note_previous_definition);
       return;
     }
     --numIvars;
@@ -728,7 +728,7 @@ Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
       TypedefDecl *TDD = dyn_cast<TypedefDecl>(PrevDecl);
       if (!TDD || !isa<ObjCInterfaceType>(TDD->getUnderlyingType())) {
         Diag(AtClassLoc, diag::err_redefinition_different_kind) << IdentList[i];
-        Diag(PrevDecl->getLocation(), diag::err_previous_definition);
+        Diag(PrevDecl->getLocation(), diag::note_previous_definition);
       }
     }
     ObjCInterfaceDecl *IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl); 
@@ -907,9 +907,9 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl,
                               : false;
       if (isInterfaceDeclKind && PrevMethod && !match 
           || checkIdenticalMethods && match) {
-          Diag(Method->getLocation(), diag::error_duplicate_method_decl)
+          Diag(Method->getLocation(), diag::err_duplicate_method_decl)
             << Method->getSelector().getName();
-          Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
+          Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
       } else {
         insMethods.push_back(Method);
         InsMap[Method->getSelector()] = Method;
@@ -924,9 +924,9 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl,
                               : false;
       if (isInterfaceDeclKind && PrevMethod && !match 
           || checkIdenticalMethods && match) {
-        Diag(Method->getLocation(), diag::error_duplicate_method_decl)
+        Diag(Method->getLocation(), diag::err_duplicate_method_decl)
           << Method->getSelector().getName();
-        Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
+        Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
       } else {
         clsMethods.push_back(Method);
         ClsMap[Method->getSelector()] = Method;
@@ -1117,9 +1117,9 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration(
   }
   if (PrevMethod) {
     // You can never have two method definitions with the same name.
-    Diag(ObjCMethod->getLocation(), diag::error_duplicate_method_decl)
+    Diag(ObjCMethod->getLocation(), diag::err_duplicate_method_decl)
       << ObjCMethod->getSelector().getName();
-    Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
+    Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
   } 
   return ObjCMethod;
 }
index 204d161f563421a32bfbcd17f94bfdf5e939b4a7..8cd223fc39d1ed2b8b75b65ee6c26564c8a454ec 100644 (file)
@@ -195,7 +195,7 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II,
   // multiply defined, reject it now.
   if (LabelDecl->getSubStmt()) {
     Diag(IdentLoc, diag::err_redefinition_of_label) << LabelDecl->getID();
-    Diag(LabelDecl->getIdentLoc(), diag::err_previous_definition);
+    Diag(LabelDecl->getIdentLoc(), diag::note_previous_definition);
     return SubStmt;
   }
   
@@ -390,7 +390,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch,
     if (DefaultStmt *DS = dyn_cast<DefaultStmt>(SC)) {
       if (TheDefaultStmt) {
         Diag(DS->getDefaultLoc(), diag::err_multiple_default_labels_defined);
-        Diag(TheDefaultStmt->getDefaultLoc(), diag::err_first_label);
+        Diag(TheDefaultStmt->getDefaultLoc(), diag::note_duplicate_case_prev);
             
         // FIXME: Remove the default statement from the switch block so that
         // we'll return a valid AST.  This requires recursing down the
@@ -436,7 +436,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch,
         Diag(CaseVals[i+1].second->getLHS()->getLocStart(),
              diag::err_duplicate_case) << CaseVals[i].first.toString(10);
         Diag(CaseVals[i].second->getLHS()->getLocStart(), 
-             diag::err_duplicate_case_prev);
+             diag::note_duplicate_case_prev);
         // FIXME: We really want to remove the bogus case stmt from the substmt,
         // but we have no way to do this right now.
         CaseListIsErroneous = true;
@@ -520,7 +520,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch,
         Diag(CR->getLHS()->getLocStart(), diag::err_duplicate_case)
           << OverlapVal.toString(10);
         Diag(OverlapStmt->getLHS()->getLocStart(), 
-             diag::err_duplicate_case_prev);
+             diag::note_duplicate_case_prev);
         // FIXME: We really want to remove the bogus case stmt from the substmt,
         // but we have no way to do this right now.
         CaseListIsErroneous = true;
index d831d48b5a158f3d2438bbf28ed7ad1a0752d613..16263f43571b2ebbb49c458612483102f80f8474 100644 (file)
@@ -1,6 +1,6 @@
 /* RUN: clang -fsyntax-only -verify %s
 */
 
-int foo(int A) { /* expected-error {{previous definition is here}} */
+int foo(int A) { /* expected-note {{previous definition is here}} */
   int A; /* expected-error {{redefinition of 'A'}} */
 }
index e7dd458dc0c2e250a01de8e34f60ec2f3cce12b1..9b7d8b7a74e4d83dab598d785c5e0035b9b36964 100644 (file)
@@ -3,14 +3,14 @@
 extern int a1[];
 int a1[1];
 
-extern int a2[]; // expected-error {{previous definition is here}}
+extern int a2[]; // expected-note {{previous definition is here}}
 float a2[1]; // expected-error {{redefinition of 'a2'}}
 
 extern int a3[][2];
 int a3[1][2];
 
-extern int a4[][2]; // expected-error {{previous definition is here}}
+extern int a4[][2]; // expected-note {{previous definition is here}}
 int a4[2]; // expected-error {{redefinition of 'a4'}}
 
-extern int a5[1][2][3]; // expected-error {{previous definition is here}}
+extern int a5[1][2][3]; // expected-note {{previous definition is here}}
 int a5[3][2][1]; // expected-error {{redefinition of 'a5'}}
index ba93aaa2eecc97a5fd8714b3e8b88dcd1cb96065..b06882b4d349ea7973a182307d108751592ccb9c 100644 (file)
@@ -30,8 +30,8 @@ int test2(int i)
 }
 
 // PR2020
-union u0;    // expected-error {{previous use is here}}
-enum u0 { U0A }; // expected-error {{error: use of 'u0' with tag type that does not match previous declaration}}
+union u0;    // expected-note {{previous use is here}}
+enum u0 { U0A }; // expected-error {{use of 'u0' with tag type that does not match previous declaration}}
 
 
 // rdar://6095136
@@ -52,6 +52,6 @@ void test4() {
 enum someenum {};  // expected-warning {{use of empty enum extension}}
 
 // <rdar://problem/6093889>
-enum e0 { // expected-error {{previous definition is here}}
+enum e0 { // expected-note {{previous definition is here}}
   E0 = sizeof(enum e0 { E1 }) // expected-error {{nested redefinition}}
 };
index 152205dd24432efe6f9ebd631e63072cd64a1f13..7c67bbaa63370c835f0771279722dc7bf2740159 100644 (file)
@@ -6,15 +6,15 @@ void f(double (* restrict a)[5]);
 int foo (__const char *__path);
 int foo(__const char *__restrict __file);
 
-void func(const char*); //expected-error{{previous declaration is here}}
-void func(char*); //expected-error{{conflicting types for 'func'}}
+void func(const char*); // expected-note {{previous declaration is here}}
+void func(char*); // expected-error{{conflicting types for 'func'}}
 
 void g(int (*)(const void **, const void **));
 void g(int (*compar)()) {
 }
 
-void h();  //expected-error{{previous declaration is here}}
-void h (const char *fmt, ...) {} //expected-error{{conflicting types for 'h'}}
+void h();  // expected-note {{previous declaration is here}}
+void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}}
 
 // PR1965
 int t5(b);          // expected-error {{parameter list without types}}
index ea40e61afb0dc6d2d1dba8f6a50a3974ec231be9..099cf9d20ea6cc515c55f513a91119ff93106c4e 100644 (file)
@@ -7,7 +7,7 @@ void func() {
    int32_t *vector[16];
    const char compDesc[16 + 1];
    int32_t compCount = 0;
-   if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-error{{previous implicit declaration is here}}
+   if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}}
    }
    return ((void *)0);
 }
index 50ce4787699f7cd46eb3473c91c731244a8c1d10..b26532c5eace59dde1972a16c5ebdb78fb23ae77 100644 (file)
@@ -3,7 +3,7 @@
 void foo(void);
 void foo(void) {} 
 void foo(void);
-void foo(void); // expected-error{{previous declaration is here}}
+void foo(void); // expected-note {{previous declaration is here}}
 
 void foo(int); // expected-error {{conflicting types for 'foo'}}
 
@@ -14,6 +14,6 @@ int funcdef()
 
 int funcdef();
 
-int funcdef2() { return 0; } // expected-error{{previous definition is here}}
+int funcdef2() { return 0; } // expected-note {{previous definition is here}}
 int funcdef2() { return 0; } // expected-error {{redefinition of 'funcdef2'}}
 
index e8c396525d1a653cd0f363f30382be93da60ae8a..2a254cceb7e76b827e03a26b86a397b6d1bd940c 100644 (file)
@@ -4,7 +4,7 @@ char *funk(int format);
 enum Test {A=-1};
 char *funk(enum Test x);
 
-int eli(float b); // expected-error {{previous declaration is here}}
+int eli(float b); // expected-note {{previous declaration is here}}
 int b(int c) {return 1;}
 
 int foo();
@@ -16,7 +16,7 @@ int foo()
 }
 
 int bar();
-int bar(int i) // expected-error {{previous definition is here}}
+int bar(int i) // expected-note {{previous definition is here}}
 {
        return 0;
 }
@@ -26,14 +26,14 @@ int bar() // expected-error {{redefinition of 'bar'}}
 }
 
 #if 0
-int foobar(int); // error {{previous declaration is here}}
+int foobar(int); // note {{previous declaration is here}}
 int foobar() // error {{conflicting types for 'foobar'}}
 {
        return 0;
 }
 #endif
 
-int wibble(); // expected-error {{previous declaration is here}}
+int wibble(); // expected-note {{previous declaration is here}}
 float wibble() // expected-error {{conflicting types for 'wibble'}}
 {
        return 0.0f;
index c45779fdeeff394ec1dd6555b30c34b4dfd3f5fa..9ad77f61a732bc30be49f074713f6c8901e1ccaa 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: clang %s -fsyntax-only -verify
-int f(int) { } // expected-error{{previous definition is here}}
+int f(int) { } // expected-note {{previous definition is here}}
 int f(int);
-int f(int) { } // expected-error{{redefinition of 'f'}}
+int f(int) { } // expected-error {{redefinition of 'f'}}
 
index a4492d12e2a640c8ef74d0337712e3c27080c4fb..489ff471fab31a1a2d51f2fb648d429b7312f689 100644 (file)
@@ -1,17 +1,17 @@
 /* RUN: clang %s -fsyntax-only -pedantic -verify
  */
 
-extern struct {int a;} x; // expected-error{{previous definition is here}}
-extern struct {int a;} x; // expected-error{{redefinition of 'x'}}
+extern struct {int a;} x; // expected-note {{previous definition is here}}
+extern struct {int a;} x; // expected-error {{redefinition of 'x'}}
 
 struct x;
 int a(struct x* b) {
 // Per C99 6.7.2.3, since the outer and inner "struct x"es have different
 // scopes, they don't refer to the same type, and are therefore incompatible
-struct x {int a;} *c = b; // expected-warning{{incompatible pointer types}}
+struct x {int a;} *c = b; // expected-warning {{incompatible pointer types}}
 }
 
 struct x {int a;} r;
 int b() {
-struct x {char x;} s = r; // expected-error{{incompatible type initializing}}
+struct x {char x;} s = r; // expected-error {{incompatible type initializing}}
 }
diff --git a/test/Sema/switch-duplicate-defaults.c b/test/Sema/switch-duplicate-defaults.c
deleted file mode 100644 (file)
index 9ef683b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: clang -fsyntax-only -verify %s
-
-void f (int z) { 
-  switch(z) {
-      default:  // expected-error {{first label is here}}
-      default:  // expected-error {{multiple default labels in one switch}}
-        break;
-  }
-} 
-
index 63e5fe33b7d6ec44ab6108978c24c645be5a6190..5886fefbd95a5df4fdaf898fcb42e02ee4322a1f 100644 (file)
@@ -8,17 +8,17 @@ void f (int z) {
 
 void foo(int X) {
   switch (X) {
-  case 42: ;                 // expected-error {{previous case value}}
+  case 42: ;                 // expected-note {{previous case}}
   case 5000000000LL:         // expected-warning {{overflow}}
   case 42:                   // expected-error {{duplicate case value}}
    ;
 
   case 100 ... 99: ;         // expected-warning {{empty case range}}
 
-  case 43: ;                 // expected-error {{previous case value}}
+  case 43: ;                 // expected-note {{previous case}}
   case 43 ... 45:  ;         // expected-error {{duplicate case value}}
 
-  case 100 ... 20000:;       // expected-error {{previous case value}}
+  case 100 ... 20000:;       // expected-note {{previous case}}
   case 15000 ... 40000000:;  // expected-error {{duplicate case value}}
   }
 }
@@ -60,3 +60,11 @@ void test4()
   }
 }
 
+void test5(int z) { 
+  switch(z) {
+    default:  // expected-note {{previous case defined here}}
+    default:  // expected-error {{multiple default labels in one switch}}
+      break;
+  }
+} 
+
index 3a2fd5a235d4ed0078d26c6b31170bdfa0237f0c..0e4b13a8434d7bcef0183e4fdf3a7f636d9e0170 100644 (file)
@@ -9,12 +9,12 @@ const int b [1] = {1};
 extern const int c[] = {1}; // expected-warning{{'extern' variable has an initializer}}
 const int c[];
 
-int i1 = 1; // expected-error{{previous definition is here}}
-int i1 = 2; // expected-error{{redefinition of 'i1'}} // expected-error{{previous definition is here}}
+int i1 = 1; // expected-note {{previous definition is here}}
+int i1 = 2; // expected-error {{redefinition of 'i1'}} // expected-note {{previous definition is here}}
 int i1;
 int i1;
-extern int i1; // expected-error{{previous definition is here}}
-static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-error{{previous definition is here}}
+extern int i1; // expected-note {{previous definition is here}}
+static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-note {{previous definition is here}}
 int i1 = 3; // expected-error{{redefinition of 'i1'}} expected-error{{non-static declaration of 'i1' follows static declaration}}
 
 __private_extern__ int pExtern;
@@ -28,11 +28,11 @@ int (*pToArray)[];
 int (*pToArray)[8];
 
 int redef[10];
-int redef[];  // expected-error{{previous definition is here}}
+int redef[];  // expected-note {{previous definition is here}}
 int redef[11]; // expected-error{{redefinition of 'redef'}}
 
 void func() {
-  extern int i1; // expected-error{{previous definition is here}}
+  extern int i1; // expected-note {{previous definition is here}}
   static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}}
 }
 
index d3904dd147d1cbbf17f0875213b7c77e91bae743..76b8a3cddef77dc98beb82a7c081036c9e48e7cf 100644 (file)
@@ -6,7 +6,7 @@ typedef __SIZE_TYPE__ size_t;
 
 
 
-typedef const int x; // expected-error {{previous definition is here}}
+typedef const int x; // expected-note {{previous definition is here}}
 extern x a;
 typedef int x;  // expected-error {{typedef redefinition with different types}}
 extern x a;
index 22546ef3b47f757a3394b1927319938c0f427584..8b01c89f3963a223947aea6ff0a2c8e266bdbb54 100644 (file)
@@ -5,7 +5,7 @@ C c;
 \r
 void D(int);\r
 \r
-class D {}; // expected-error{{previous use is here}}\r
+class D {}; // expected-note {{previous use is here}}\r
 \r
 void foo()\r
 {\r
@@ -15,7 +15,7 @@ void foo()
 \r
 class D; \r
 \r
-enum D; // expected-error{{use of 'D' with tag type that does not match previous declaration}}\r
+enum D; // expected-error {{use of 'D' with tag type that does not match previous declaration}}\r
 \r
 class A * A;\r
 \r
index f4a6debd2dd822eeddc8afc995b59b609c48801c..d611364cf03cc5fbc3d6502fb40f4b447aef1b8c 100644 (file)
@@ -6,30 +6,30 @@ void test() {
   if (int x=0) ++x;
 
   typedef int arr[10];
-  while (arr x=0) ; // expected-error: {{an array type is not allowed here}} expected-error: {{initialization with '{...}' expected for array}}
-  while (int f()=0) ; // expected-error: {{a function type is not allowed here}}
+  while (arr x=0) ; // expected-error {{an array type is not allowed here}} expected-error {{initialization with '{...}' expected for array}}
+  while (int f()=0) ; // expected-error {{a function type is not allowed here}}
 
   struct S {} s;
-  if (s) ++x; // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
-  while (struct S x=s) ; // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
-  do ; while (s); // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
-  for (;s;) ; // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
-  switch (s) {} // expected-error: {{statement requires expression of integer type ('struct S' invalid)}}
+  if (s) ++x; // expected-error {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
+  while (struct S x=s) ; // expected-error {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
+  do ; while (s); // expected-error {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
+  for (;s;) ; // expected-error {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
+  switch (s) {} // expected-error {{statement requires expression of integer type ('struct S' invalid)}}
 
-  while (struct S {} x=0) ; // expected-error: {{types may not be defined in conditions}} expected-error: {{incompatible type}} expected-error: {{expression must have bool type}}
-  while (struct {} x=0) ; // expected-error: {{types may not be defined in conditions}} expected-error: {{incompatible type}} expected-error: {{expression must have bool type}}
-  switch (enum {E} x=0) ; // expected-error: {{types may not be defined in conditions}} expected-error: {{incompatible type}}
+  while (struct S {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{incompatible type}} expected-error {{expression must have bool type}}
+  while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{incompatible type}} expected-error {{expression must have bool type}}
+  switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{incompatible type}}
 
-  if (int x=0) { // expected-error: {{previous definition is here}}
-    int x;  // expected-error: {{redefinition of 'x'}}
+  if (int x=0) { // expected-note {{previous definition is here}}
+    int x;  // expected-error {{redefinition of 'x'}}
   }
   else
-    int x;  // expected-error: {{redefinition of 'x'}}
-  while (int x=0) int x; // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
-  while (int x=0) { int x; } // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
-  for (int x; int x=0; ) ; // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
-  for (int x; ; ) int x; // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
-  for (; int x=0; ) int x; // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
-  for (; int x=0; ) { int x; } // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
-  switch (int x=0) { default: int x; } // expected-error: {{redefinition of 'x'}} expected-error: {{previous definition is here}}
+    int x;  // expected-error {{redefinition of 'x'}}
+  while (int x=0) int x; // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
+  while (int x=0) { int x; } // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
+  for (int x; int x=0; ) ; // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
+  for (int x; ; ) int x; // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
+  for (; int x=0; ) int x; // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
+  for (; int x=0; ) { int x; } // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
+  switch (int x=0) { default: int x; } // expected-error {{redefinition of 'x'}} expected-note {{previous definition is here}}
 }
index 1aedb29c4e0b41a08ca4811a2c4eb6569d476b36..fc398e28ba4cbb868bc5df321569f8a6c126f488 100644 (file)
@@ -5,7 +5,7 @@ typedef int INT;
 class Foo {
   Foo();
   (Foo)(float) { }
-  explicit Foo(int); // expected-error{{previous declaration is here}}
+  explicit Foo(int); // expected-note {{previous declaration is here}}
   Foo(const Foo&);
 
   ((Foo))(INT); // expected-error{{cannot be redeclared}}
index 3c2401f110e1ca6d27d8abbafb5867e17f457511..17e73bce9a6047ebdb0e997d17213ef579553f24 100644 (file)
@@ -34,8 +34,8 @@ typedef int INT;
 typedef INT* INT_PTR;
 
 class Z { 
-  operator int(); // expected-error{{previous declaration is here}}
-  operator int**(); // expected-error{{previous declaration is here}}
+  operator int(); // expected-note {{previous declaration is here}}
+  operator int**(); // expected-note {{previous declaration is here}}
   
   operator INT();  // expected-error{{conversion function cannot be redeclared}}
   operator INT_PTR*(); // expected-error{{conversion function cannot be redeclared}}
index 1d690606583c121c1b9717a24002ad4c5898aac2..7d12e22329d3fee4137da182f79abc520c44c897 100644 (file)
@@ -23,7 +23,7 @@ void f() {
 
   // Declarations.
   int fd(T(a)); // expected-warning {{parentheses were disambiguated as a function declarator}}
-  T(*d)(int(p)); // expected-warning {{parentheses were disambiguated as a function declarator}} expected-warning {{statement was disambiguated as declaration}} expected-error {{previous definition is here}}
+  T(*d)(int(p)); // expected-warning {{parentheses were disambiguated as a function declarator}} expected-warning {{statement was disambiguated as declaration}} expected-note {{previous definition is here}}
   T(d)[5]; // expected-warning {{statement was disambiguated as declaration}} expected-error {{redefinition of 'd'}}
   typeof(int[])(f) = { 1, 2 }; // expected-warning {{statement was disambiguated as declaration}}
   void(b)(int);
index 3acf119265c4aca2006306ea4a08752285bd21f3..286be6106b118a43137ccf41b096f5d35bdedf6f 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang -fsyntax-only -verify %s
 void f(int i);
-void f(int i = 0); // expected-error {{previous definition is here}}
+void f(int i = 0); // expected-note {{previous definition is here}}
 void f(int i = 17); // expected-error {{redefinition of default argument}}
 
 
index cb5bd23a9eb2e32d64f4100261402fe0d7259f11..7f791daf5ee85da2156199a799c9ed7421f08a77 100644 (file)
@@ -31,8 +31,8 @@ struct E {
 };
 
 struct F {
-  (~F)(); // expected-error{{previous declaration is here}}
-  ~F(); // expected-error{{destructor cannot be redeclared}}
+  (~F)(); // expected-note {{previous declaration is here}}
+  ~F(); // expected-error {{destructor cannot be redeclared}}
 };
 
 ~; // expected-error {{expected class name}}
index ee72f0cdaf17c22f1d9291efd4a39cea20326f0e..51aeab85f9856dfc079a9fafa4bdfa725885e403 100644 (file)
@@ -2,7 +2,7 @@
 
 // PR2942
 typedef void fn(int);
-fn f; // expected-error{{previous declaration is here}}
+fn f; // expected-note {{previous declaration is here}}
 
 int g(int x, int y);
 int g(int x, int y = 2);
@@ -10,7 +10,7 @@ int g(int x, int y = 2);
 typedef int g_type(int, int);
 g_type g;
 
-int h(int x) { // expected-error{{previous definition is here}}
+int h(int x) { // expected-note {{previous definition is here}}
   return g(x);
 }
 
index 62251d3535e425ec96295fcdee84af5057cba9f3..848dc2767157284d988aeeb7460b34e73331c59e 100644 (file)
@@ -1,18 +1,18 @@
 // RUN: clang -fsyntax-only -verify %s 
-namespace A { // expected-error {{error: previous definition is here}}
+namespace A { // expected-note {{previous definition is here}}
   int A;
   void f() { A = 0; }
 }
 
-void f() { A = 0; } // expected-error {{error: unexpected namespace name 'A': expected expression}}
-int A; // expected-error {{error: redefinition of 'A' as different kind of symbol}}
-class A; // expected-error {{error: redefinition of 'A' as different kind of symbol}}
+void f() { A = 0; } // expected-error {{unexpected namespace name 'A': expected expression}}
+int A; // expected-error {{redefinition of 'A' as different kind of symbol}}
+class A; // expected-error {{redefinition of 'A' as different kind of symbol}}
 
-class B {}; // expected-error {{error: previous definition is here}}
-namespace B {} // expected-error {{error: redefinition of 'B' as different kind of symbol}}
+class B {}; // expected-note {{previous definition is here}}
+namespace B {} // expected-error {{redefinition of 'B' as different kind of symbol}}
 
-void C(); // expected-error {{error: previous definition is here}}
-namespace C {} // expected-error {{error: redefinition of 'C' as different kind of symbol}}
+void C(); // expected-note {{previous definition is here}}
+namespace C {} // expected-error {{redefinition of 'C' as different kind of symbol}}
 
 namespace D {
   class D {};
@@ -38,7 +38,7 @@ namespace S1 {
     
     namespace S3 {
       void f() {
-        x = 0; // expected-error {{error: incompatible type assigning 'int', expected 'class B'}}
+        x = 0; // expected-error {{incompatible type assigning 'int', expected 'class B'}}
       }
     }
 
index 9b0d0e205e7fc145cf4ae8a34fc105395c5bb99e..9814725085e9bc1458a8adb298db4f0aa4c50aee 100644 (file)
@@ -6,22 +6,22 @@ void f(int, int);
 void f(int, ...);
 
 typedef float Float;
-void f(int, Float); // expected-error {{error: previous declaration is here}}
+void f(int, Float); // expected-note {{previous declaration is here}}
 
-int f(int, Float); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
+int f(int, Float); // expected-error {{functions that differ only in their return type cannot be overloaded}}
 
-void g(void); // expected-error {{error: previous declaration is here}}
-int g(); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
+void g(void); // expected-note {{previous declaration is here}}
+int g(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
 
 class X {
   void f();
   void f(int);
   void f() const;
 
-  void g(int); // expected-error {{error: previous declaration is here}}
-  void g(int, float); // expected-error {{error: previous declaration is here}}
-  int g(int, Float); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
+  void g(int); // expected-note {{previous declaration is here}}
+  void g(int, float); // expected-note {{previous declaration is here}}
+  int g(int, Float); // expected-error {{functions that differ only in their return type cannot be overloaded}}
 
   static void g(float);
-  static void g(int); // expected-error {{error: static and non-static member functions with the same parameter types cannot be overloaded}}
+  static void g(int); // expected-error {{static and non-static member functions with the same parameter types cannot be overloaded}}
 };
index c37a08ab3aa88e15590fac67662f84d5fa19c6b6..eabcef8b3198fe164ddd3c86dbf7544d022c8072 100644 (file)
@@ -1,12 +1,12 @@
 // RUN: clang -fsyntax-only -verify %s 
 
 typedef int INT;
-typedef INT REALLY_INT; // expected-error{{previous definition is here}}
+typedef INT REALLY_INT; // expected-note {{previous definition is here}}
 typedef REALLY_INT REALLY_REALLY_INT;
 typedef REALLY_INT BOB;
 typedef float REALLY_INT; // expected-error{{typedef redefinition with different types ('float' vs 'INT')}}
 
 class X {
-  typedef int result_type; // expected-error{{previous definition is here}}
-  typedef INT result_type; // expected-error{{redefinition of 'result_type'}}
+  typedef int result_type; // expected-note {{previous definition is here}}
+  typedef INT result_type; // expected-error {{redefinition of 'result_type'}}
 };
index 70c7ed55f1e20fa91d1365a500ad4f76e4074268..07e89120fb87b535cb2e96e120e7427ad38d4f08 100644 (file)
@@ -10,7 +10,7 @@
 @end
 
 @implementation Subclass
-- (void) method {;} // expected-error {{previous declaration is here}}
+- (void) method {;} // expected-note {{previous declaration is here}}
 - (void) method {;} // expected-error {{duplicate declaration of method 'method'}}
 @end
 
index fdaccf3f8bccb71d6d5fc07115567a523b27dc06..377f62f5baade37728194031873b6d6cec4a2d88 100644 (file)
@@ -2,7 +2,7 @@
 
 @compatibility_alias alias4 foo; // expected-warning {{cannot find interface declaration for 'foo'}}
 
-@class class2; // expected-error {{previous declaration is here}}
+@class class2; // expected-note {{previous declaration is here}}
 @class class3;
 
 typedef int I;  // expected-warning {{previous declaration is here}}
@@ -13,7 +13,7 @@ typedef int I;  // expected-warning {{previous declaration is here}}
 @compatibility_alias alias class3;   // expected-error {{conflicting types for alias 'alias'}}
 
 
-typedef int alias2;    // expected-error {{previous declaration is here}}
+typedef int alias2;    // expected-note {{previous declaration is here}}
 @compatibility_alias alias2 class3;  // expected-error {{conflicting types for alias 'alias2'}}
 
 alias *p;
index bdaeefe5a368549ac84ba4cca68f63581f8e326a..4eb2007d197c9d75f0d02119f709ac8025d5c328 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: clang -fsyntax-only -verify %s
 
 // Note: GCC doesn't produce any of the following errors.
-@interface Super @end // expected-error {{previous definition is here}}
+@interface Super @end // expected-note {{previous definition is here}}
 
 @interface MyWpModule @end  // expected-note {{previous definition is here}}
 
index 36a98a24a462d60a93e3768cd3dcbd4b9ec5a25d..985a4c147f9766cd2de562359a2d18ee395749b8 100644 (file)
@@ -8,7 +8,7 @@
 @interface T @end
 
 @interface class1 : SUPER
-- (int) meth;  // expected-error {{previous declaration is here}}
+- (int) meth;  // expected-note {{previous declaration is here}}
 - (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}
 - (T*) meth1;  
 - (T*) meth1;
@@ -16,7 +16,7 @@
 @end
 
 @interface class1(cat)
-- (int) catm : (char)ch1; // expected-error {{previous declaration is here}}
+- (int) catm : (char)ch1; // expected-note {{previous declaration is here}}
 - (int) catm1 : (char)ch : (int)i;
 - (int) catm : (char*)ch1; // expected-error {{duplicate declaration of method 'catm:'}}
 + (int) catm1 : (char)ch : (int)i;
 @end
 
 @interface class1(cat1)
-+ (int) catm1 : (char)ch : (int)i; // expected-error {{previous declaration is here}}
-+ (T*) meth1; // expected-error {{previous declaration is here}}
++ (int) catm1 : (char)ch : (int)i; // expected-note {{previous declaration is here}}
++ (T*) meth1; // expected-note {{previous declaration is here}}
 + (int) catm1 : (char)ch : (int*)i; // expected-error {{duplicate declaration of method 'catm1::'}}
 + (T**) meth1; // expected-error {{duplicate declaration of method 'meth1'}}
 + (int) foobar;
 @end
 
 @protocol P
-- (int) meth; // expected-error {{previous declaration is here}}
+- (int) meth; // expected-note {{previous declaration is here}}
 - (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}
 @end
 
index 28c6068afd021df41c6e56d5721158f7838c98a6..fa9b8674be0dd55960f07fb3e957adfb1fb3b1c9 100644 (file)
@@ -1,11 +1,11 @@
 // RUN: clang -fsyntax-only -verify %s
 
-@interface Foo // expected-error {{previous definition is here}}
+@interface Foo // expected-note {{previous definition is here}}
 @end
 
 float Foo;     // expected-error {{redefinition of 'Foo' as different kind of symbol}}
 
-@class Bar;  // expected-error {{previous definition is here}}
+@class Bar;  // expected-note {{previous definition is here}}
 
 typedef int Bar;  // expected-error {{redefinition of 'Bar' as different kind of symbol}}
 
@@ -13,12 +13,12 @@ typedef int Bar;  // expected-error {{redefinition of 'Bar' as different kind of
 @end
 
 
-typedef int OBJECT; // expected-error {{previous definition is here}}
+typedef int OBJECT; // expected-note {{previous definition is here}}
 
 @class OBJECT ;        // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
 
 
-typedef int Gorf;  // expected-error {{previous definition is here}}
+typedef int Gorf;  // expected-note {{previous definition is here}}
 
 @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
 
index 6afee0d3d4d70fdbb7970f7504ae8801d0d62429..00f3204c6287b7bb9879d49b9314c85c56dbac50 100644 (file)
@@ -5,11 +5,11 @@
 @protocol P3 @end
 
 @interface INTF 
-- (INTF*) METH1;       // expected-error {{previous declaration is here}}
+- (INTF*) METH1;       // expected-note {{previous declaration is here}}
 - (INTF<P1>*) METH1;   // expected-error {{duplicate declaration of method 'METH1'}}
 
 - (INTF<P1,P2>*) METH2;
-- (INTF<P2,P1>*) METH2;  // expected-error {{previous declaration is here}}
+- (INTF<P2,P1>*) METH2;  // expected-note {{previous declaration is here}}
 - (INTF<P2,P1,P3>*) METH2;  // expected-error {{duplicate declaration of method 'METH2'}}
 
 - (INTF<P2,P1,P3>*) METH3;
index cf0ef53cae2ff7b350fc30635194b09affdc1c6f..ef226a515f1c0da112bef6f94ef90667e81fb581 100644 (file)
@@ -4,17 +4,17 @@
 
 @interface SUPER <SUPER> @end // expected-warning {{cannot find protocol definition for 'SUPER'}}
 
-typedef int INTF; //  expected-error {{previous definition is here}}
+typedef int INTF; //  expected-note {{previous definition is here}}
 
 @interface INTF @end // expected-error {{redefinition of 'INTF' as different kind of symbol}}
 
-@interface OBJECT @end // expected-error {{previous definition is here}}
+@interface OBJECT @end // expected-note {{previous definition is here}}
 
 @interface INTF1 : OBJECT @end // expected-note {{previous definition is here}}
 
 @interface INTF1 : OBJECT @end // expected-error {{duplicate interface definition for class 'INTF1'}}
 
-typedef int OBJECT; // expected-error {{previous definition is here}}  \
+typedef int OBJECT; // expected-note {{previous definition is here}}  \
                       expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
 
 @interface INTF2 : OBJECT @end // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
index dedce58d2c0f8f577171ff544b07e9bb43aca8f4..a3a185221b30ae86832e5e94428f0172ffe6cfd7 100644 (file)
@@ -1,8 +1,8 @@
 // RUN: clang -fsyntax-only -verify %s
 
-typedef int INTF3; // expected-error {{previous definition is here}}
+typedef int INTF3; // expected-note {{previous definition is here}}
 
-@interface SUPER @end // expected-error {{previous definition is here}}
+@interface SUPER @end // expected-note {{previous definition is here}}
 
 @interface OBJECT @end
 
index c5a6be45a4fb88ab0a859044241ef3c07cf22056..3f27b2c1772b5526083eb581c4e20f00878ed425 100644 (file)
@@ -3,7 +3,7 @@
 @interface INTF 
 {
 @public
-       int IVAR; // expected-error {{previous definition is here}}
+       int IVAR; // expected-note {{previous definition is here}}
 }
 @end
 
@@ -54,7 +54,7 @@
 @interface INTF3
 {
 @public
-       int IVAR; // expected-error {{previous definition is here}}
+       int IVAR; // expected-note {{previous definition is here}}
 }
 @end
 
index 4e810a29a8129ee7c1c5b21ba765b17550f0e0c8..4e464578fdecd488f91179219420ca4260c754a1 100644 (file)
@@ -8,11 +8,11 @@ typedef int FOO();
        struct F {} JJ;
        int arr[];  // expected-error {{field 'arr' has incomplete type}}
        struct S IC;  // expected-error {{field 'IC' has incomplete type}}
-       struct T { // expected-error {{previous definition is here}}
+       struct T { // expected-note {{previous definition is here}}
          struct T {} X;  // expected-error {{nested redefinition of 'struct'}}
        }YYY; 
        FOO    BADFUNC;  // expected-error {{field 'BADFUNC' declared as a function}}
-       int kaka;       // expected-error {{previous definition is here}}
+       int kaka;       // expected-note {{previous definition is here}}
        int kaka;       // expected-error {{duplicate member 'kaka'}}
        char ch[];      // expected-error {{field 'ch' has incomplete type}}
 }