Here's a patch that removes one place where the CXXScopeSpec was being
modified when it shouldn't have been, and in doing so causing the wrong
diagnostic message to be emitted. Updating SS was a remnant of a version of
my namespace correction patch which didn't get cleaned up properly (removed)
before submission. All tests pass and the proper message is given for Chris'
example (which was added to the unit test) in
http://llvm.org/bugs/show_bug.cgi?id=10318
Cheers,
Kaelyn
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 49c3f8a..06c62fd 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -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)
diff --git a/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp b/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
index 3896257..fd0c976 100644
--- a/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
+++ b/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
@@ -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'?}}
+
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits