Fix an incorrect namespace typo-correction diagnostic, from Kaelyn

Uhrain! Fixes PR10318.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Gregor 2011-07-13 21:36:26 +00:00
Родитель d15608e986
Коммит 1255aaf102
2 изменённых файлов: 14 добавлений и 6 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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'?}}
}