[cfe-commits] r155723 - in /cfe/trunk: include/clang/Basic/DiagnosticCommonKinds.td lib/Parse/ParseDecl.cpp lib/Sema/SemaDecl.cpp test/FixIt/fixit.cpp test/Parser/cxx-using-declaration.cpp

Kaelyn Uhrain rikka at google.com
Fri Apr 27 11:26:49 PDT 2012


Author: rikka
Date: Fri Apr 27 13:26:49 2012
New Revision: 155723

URL: http://llvm.org/viewvc/llvm-project?rev=155723&view=rev
Log:
Imrpove the note text for when a non-type decl hides a tag type

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

Modified: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=155723&r1=155722&r2=155723&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Fri Apr 27 13:26:49 2012
@@ -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<

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=155723&r1=155722&r2=155723&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Apr 27 13:26:49 2012
@@ -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;
       }
 

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=155723&r1=155722&r2=155723&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Apr 27 13:26:49 2012
@@ -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;

Modified: cfe/trunk/test/FixIt/fixit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit.cpp?rev=155723&r1=155722&r2=155723&view=diff
==============================================================================
--- cfe/trunk/test/FixIt/fixit.cpp (original)
+++ cfe/trunk/test/FixIt/fixit.cpp Fri Apr 27 13:26:49 2012
@@ -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}}
 };

Modified: cfe/trunk/test/Parser/cxx-using-declaration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-using-declaration.cpp?rev=155723&r1=155722&r2=155723&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-using-declaration.cpp (original)
+++ cfe/trunk/test/Parser/cxx-using-declaration.cpp Fri Apr 27 13:26:49 2012
@@ -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() {





More information about the cfe-commits mailing list