]> granicus.if.org Git - clang/commitdiff
Imrpove the note text for when a non-type decl hides a tag type
authorKaelyn Uhrain <rikka@google.com>
Fri, 27 Apr 2012 18:26:49 +0000 (18:26 +0000)
committerKaelyn Uhrain <rikka@google.com>
Fri, 27 Apr 2012 18:26:49 +0000 (18:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155723 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticCommonKinds.td
lib/Parse/ParseDecl.cpp
lib/Sema/SemaDecl.cpp
test/FixIt/fixit.cpp
test/Parser/cxx-using-declaration.cpp

index c1c933198de2783abfba71e9e07aaa998b074a7d..ef0232e63d17dadf94dee691478fc984560580ef 100644 (file)
@@ -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<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<
index 134bc97a1b69933921cd31f5b568e63c95fba5c7..1c0815a669b6c4fdf30252fa10b2381d298890fb 100644 (file)
@@ -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;
       }
 
index ec950d18421ba5a5726328a5fef963c4be8f50c2..28b3aa8013ed21ee4ddbb8292f05cc9585e87165 100644 (file)
@@ -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;
index 9a2acd33e0ad8f2abc5a49b0bd7fc82b338a14f1..e9b4d75a6aa0b43e2933200af0d5bd0419b22dcd 100644 (file)
@@ -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}}
 };
index 8c60b9b7a2564e5eb61bbfb3d2130ef519699da2..320fd09e55a191a098d378e99779b61cc379029c 100644 (file)
@@ -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() {