]> granicus.if.org Git - clang/commitdiff
Simplify struct/class tag mismatch warning, per Sebastian's suggestion
authorDouglas Gregor <dgregor@apple.com>
Mon, 18 May 2009 18:46:22 +0000 (18:46 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 18 May 2009 18:46:22 +0000 (18:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72027 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp

index d62dc487c42a6c01717aa64614b649fe9a5d889b..f31212e54035023002b37bf68c7f6687e9a82f0b 100644 (file)
@@ -835,7 +835,7 @@ def err_use_with_wrong_tag : Error<
   "use of %0 with tag type that does not match previous declaration">;
 def warn_struct_class_tag_mismatch : Warning<
     "%select{struct|class}0 %select{|template}1 %2 was previously declared "
-    "as a %select{struct|class}3 %select{|template}1">,
+    "as a %select{class|struct}0 %select{|template}1">,
     InGroup<MismatchedTags>, DefaultIgnore;
 def ext_forward_ref_enum : Extension<
   "ISO C forbids forward references to 'enum' types">;
index 92344d30d3e1234c2362a23369770dc84643be85..ceb5822433935a350d46ea147ad99c73b0f20725 100644 (file)
@@ -3300,7 +3300,6 @@ bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
     Diag(NewTagLoc, diag::warn_struct_class_tag_mismatch)
       << (NewTag == TagDecl::TK_class)
       << isTemplate << &Name
-      << (OldTag == TagDecl::TK_class)
       << CodeModificationHint::CreateReplacement(SourceRange(NewTagLoc),
                               OldTag == TagDecl::TK_class? "class" : "struct");
     Diag(Previous->getLocation(), diag::note_previous_use);