From f05e49e607a632f95613a26a7c76a6378b2b2d7d Mon Sep 17 00:00:00 2001 From: Kaelyn Uhrain Date: Mon, 16 Dec 2013 19:25:47 +0000 Subject: [PATCH] Revert "Maybe add new warning for shadowing simple tag types" This reverts commit 2b43f500cfea10a8c59c986dcfc24fd08eecc77d. This was accidentally committed because I failed to notice my client wasn't clean prior to submitting a fix for a crasher. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197410 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 4 ---- lib/Sema/SemaDecl.cpp | 8 +------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 82b10ed138..807389cb02 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3662,10 +3662,6 @@ def err_redefinition_different_type : Error< "redefinition of %0 with a different type%diff{: $ vs $|}1,2">; def err_redefinition_different_kind : Error< "redefinition of %0 as different kind of symbol">; -def warn_declaration_shadows_tag_type : Warning< - "declaration of %0 shadows %1 %0; '%1' tag will be needed to refer to the %1">, - InGroup, DefaultIgnore; -def note_shadowed_tag_type_declaration : Note<"%1 %0 declared here">; def warn_forward_class_redefinition : Warning< "redefinition of forward class %0 of a typedef name of an object type is ignored">, InGroup>; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index c4325c6d70..6eb8955dbc 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4398,14 +4398,8 @@ NamedDecl *Sema::HandleDeclarator(Scope *S, Declarator &D, // tag type. Note that this does does not apply if we're declaring a // typedef (C++ [dcl.typedef]p4). if (Previous.isSingleTagDecl() && - D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef) { - TagDecl *TD = Previous.getAsSingle(); - Diag(D.getIdentifierLoc(), diag::warn_declaration_shadows_tag_type) - << Name << TD->getKindName(); - Diag(TD->getLocation(), diag::note_shadowed_tag_type_declaration) - << Name << TD->getKindName(); + D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef) Previous.clear(); - } // Check that there are no default arguments other than in the parameters // of a function declaration (C++ only). -- 2.40.0