diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-05-10 21:32:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-05-10 21:32:16 +0000 |
commit | 9986cce3eacfd5d6f9eea1acc3f07943425b3a22 (patch) | |
tree | 5f389c697e28ea27644f28689b1eff286784e2ec /test/SemaTemplate | |
parent | 84e1942597fa8b34584a6fc1cceb4abf0e4eb0ca (diff) |
Improve diagnosis of unknown template name.
When an undeclared identifier in a context that requires a type is followed by
'<', only look for type templates when typo-correcting, tweak the diagnostic
text to say that a template name (not a type name) was undeclared, and parse
the template arguments when recovering from the error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/deduction-crash.cpp | 2 | ||||
-rw-r--r-- | test/SemaTemplate/explicit-instantiation.cpp | 2 | ||||
-rw-r--r-- | test/SemaTemplate/ms-lookup-template-base-classes.cpp | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/test/SemaTemplate/deduction-crash.cpp b/test/SemaTemplate/deduction-crash.cpp index ff7421a910..c94c9db94e 100644 --- a/test/SemaTemplate/deduction-crash.cpp +++ b/test/SemaTemplate/deduction-crash.cpp @@ -2,7 +2,7 @@ // Note that the error count below doesn't matter. We just want to // make sure that the parser doesn't crash. -// CHECK: 16 errors +// CHECK: 17 errors // PR7511 template<a> diff --git a/test/SemaTemplate/explicit-instantiation.cpp b/test/SemaTemplate/explicit-instantiation.cpp index 010716dd14..42d9f4d332 100644 --- a/test/SemaTemplate/explicit-instantiation.cpp +++ b/test/SemaTemplate/explicit-instantiation.cpp @@ -95,7 +95,7 @@ namespace PR7622 { struct basic_streambuf; template<typename,typename> - struct basic_streambuf{friend bob<>()}; // expected-error{{unknown type name 'bob'}} \ + struct basic_streambuf{friend bob<>()}; // expected-error{{no template named 'bob'}} \ // expected-error{{expected member name or ';' after declaration specifiers}} template struct basic_streambuf<int>; } diff --git a/test/SemaTemplate/ms-lookup-template-base-classes.cpp b/test/SemaTemplate/ms-lookup-template-base-classes.cpp index 6afc709126..a41248ee1b 100644 --- a/test/SemaTemplate/ms-lookup-template-base-classes.cpp +++ b/test/SemaTemplate/ms-lookup-template-base-classes.cpp @@ -347,8 +347,7 @@ template <typename T> struct B : A<T> { }; template <typename T> struct C : A<T> { // Incorrect form. - NameFromBase<T> m; // expected-error {{unknown type name 'NameFromBase'}} - //expected-error@-1 {{expected member name or ';' after declaration specifiers}} + NameFromBase<T> m; // expected-error {{no template named 'NameFromBase'}} }; } |