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
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td
index c1c9331..ef0232e 100644
--- a/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/include/clang/Basic/DiagnosticCommonKinds.td
@@ -74,8 +74,8 @@
def warn_module_build : Warning<"building module '%0' from source">,
InGroup<ModuleBuild>, 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 134bc97..1c0815a 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1683,7 +1683,7 @@
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 ec950d1..28b3aa8 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -569,7 +569,7 @@
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 9a2acd3..e9b4d75 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -211,7 +211,7 @@
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 8c60b9b..320fd09 100644
--- a/test/Parser/cxx-using-declaration.cpp
+++ b/test/Parser/cxx-using-declaration.cpp
@@ -51,7 +51,7 @@
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() {