]> granicus.if.org Git - clang/commitdiff
Fix an incorrect namespace typo-correction diagnostic, from Kaelyn
authorDouglas Gregor <dgregor@apple.com>
Wed, 13 Jul 2011 21:36:26 +0000 (21:36 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 13 Jul 2011 21:36:26 +0000 (21:36 +0000)
Uhrain! Fixes PR10318.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135086 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp

index c5caae279cb7acd016b9ada8fabe59123ca52a76..f650724535be32e7c9a88797ebbeb37ea69acfdb 100644 (file)
@@ -536,9 +536,6 @@ Corrected:
            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)
index 38962575118f33b47fa9db88357430bccd767b86..fd0c976bdd78d24491e294d15aa8eb2c3f894305 100644 (file)
@@ -43,7 +43,7 @@ namespace N {
   }
 
   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 @@ namespace realstd {
 }
 
 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'?}}
+
 }