From 52b2fe2d70d83f73ee59e9ad3d0ba8ac154acfda Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 18 May 2009 18:46:22 +0000 Subject: [PATCH] Simplify struct/class tag mismatch warning, per Sebastian's suggestion git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72027 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 2 +- lib/Sema/SemaDecl.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index d62dc487c4..f31212e540 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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, DefaultIgnore; def ext_forward_ref_enum : Extension< "ISO C forbids forward references to 'enum' types">; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 92344d30d3..ceb5822433 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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); -- 2.40.0