[cfe-commits] r135086 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp

Douglas Gregor dgregor at apple.com
Wed Jul 13 14:36:26 PDT 2011


Author: dgregor
Date: Wed Jul 13 16:36:26 2011
New Revision: 135086

URL: http://llvm.org/viewvc/llvm-project?rev=135086&view=rev
Log:
Fix an incorrect namespace typo-correction diagnostic, from Kaelyn
Uhrain! Fixes PR10318.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=135086&r1=135085&r2=135086&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jul 13 16:36:26 2011
@@ -536,9 +536,6 @@
            UnqualifiedDiag = diag::err_unknown_typename_suggest;
            QualifiedDiag = diag::err_unknown_nested_typename_suggest;
          }
-        
-        if (Corrected.getCorrectionSpecifier())
-          SS.MakeTrivial(Context, Corrected.getCorrectionSpecifier(), SourceRange(NameLoc));
 
         if (SS.isEmpty())
           Diag(NameLoc, UnqualifiedDiag)

Modified: cfe/trunk/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp?rev=135086&r1=135085&r2=135086&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp (original)
+++ cfe/trunk/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp Wed Jul 13 16:36:26 2011
@@ -43,7 +43,7 @@
   }
 
   void f() {
-    myvector v; // expected-error{{no type named 'myvector' in namespace 'N::inner'; did you mean 'inner::myvector'?}}
+    myvector v; // expected-error{{unknown type name 'myvector'; did you mean 'inner::myvector'?}}
   }
 }
 
@@ -56,6 +56,17 @@
 }
 
 void f() {
-  mylinkedlist v; // expected-error{{no type named 'mylinkedlist' in namespace 'realstd'; did you mean 'realstd::mylinkedlist'?}}
-  nylinkedlist w; // expected-error{{no type named 'nylinkedlist' in namespace 'realstd'; did you mean 'realstd::mylinkedlist'?}}
+  mylinkedlist v; // expected-error{{unknown type name 'mylinkedlist'; did you mean 'realstd::mylinkedlist'?}}
+  nylinkedlist w; // expected-error{{unknown type name 'nylinkedlist'; did you mean 'realstd::mylinkedlist'?}}
+}
+
+// Test case from http://llvm.org/bugs/show_bug.cgi?id=10318
+namespace llvm {
+ template <typename T> class GraphWriter {}; // expected-note{{'llvm::GraphWriter' declared here}}
+}
+
+struct S {};
+void bar() {
+ GraphWriter<S> x; //expected-error{{no template named 'GraphWriter'; did you mean 'llvm::GraphWriter'?}}
+
 }





More information about the cfe-commits mailing list