From 392b3f5798a62fe038082df0a5e2244b08b917d8 Mon Sep 17 00:00:00 2001 From: Kaelyn Uhrain Date: Fri, 27 Apr 2012 18:26:49 +0000 Subject: [PATCH] Imrpove the note text for when a non-type decl hides a tag type git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155723 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticCommonKinds.td | 4 ++-- lib/Parse/ParseDecl.cpp | 2 +- lib/Sema/SemaDecl.cpp | 2 +- test/FixIt/fixit.cpp | 2 +- test/Parser/cxx-using-declaration.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index c1c933198d..ef0232e63d 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -74,8 +74,8 @@ def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, def warn_module_build : Warning<"building module '%0' from source">, InGroup, DefaultIgnore; def note_pragma_entered_here : Note<"#pragma entered here">; -def note_decl_shadowing_tag_type : Note< - "non-type %0 shadowing %1 %0 declared here">; +def note_decl_hiding_tag_type : Note< + "%1 %0 is hidden by a non-type declaration of %0 here">; // Sema && Lex def ext_longlong : Extension< diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 134bc97a1b..1c0815a669 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1683,7 +1683,7 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS, if (Actions.LookupParsedName(R, getCurScope(), SS)) { for (LookupResult::iterator I = R.begin(), IEnd = R.end(); I != IEnd; ++I) - Diag((*I)->getLocation(), diag::note_decl_shadowing_tag_type) + Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type) << TokenName << TagName; } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ec950d1842..28b3aa8013 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -569,7 +569,7 @@ Corrected: if (LookupParsedName(R, S, &SS)) { for (LookupResult::iterator I = R.begin(), IEnd = R.end(); I != IEnd; ++I) - Diag((*I)->getLocation(), diag::note_decl_shadowing_tag_type) + Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type) << Name << TagName; } break; diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp index 9a2acd33e0..e9b4d75a6a 100644 --- a/test/FixIt/fixit.cpp +++ b/test/FixIt/fixit.cpp @@ -211,7 +211,7 @@ class Foo { public: enum Bar { X, Y }; void SetBar(Bar bar); - Bar Bar(); // expected-note 2 {{non-type 'Bar' shadowing enum 'Bar' declared here}} + Bar Bar(); // expected-note 2 {{enum 'Bar' is hidden by a non-type declaration of 'Bar' here}} private: Bar bar_; // expected-error {{must use 'enum' tag to refer to type 'Bar' in this scope}} }; diff --git a/test/Parser/cxx-using-declaration.cpp b/test/Parser/cxx-using-declaration.cpp index 8c60b9b7a2..320fd09e55 100644 --- a/test/Parser/cxx-using-declaration.cpp +++ b/test/Parser/cxx-using-declaration.cpp @@ -51,7 +51,7 @@ namespace foo { class Bar {}; } -void Bar(int); // expected-note{{non-type 'Bar' shadowing class 'Bar' declared here}} +void Bar(int); // expected-note{{class 'Bar' is hidden by a non-type declaration of 'Bar' here}} using foo::Bar; void ambiguity() { -- 2.40.0