diff options
author | Reid Kleckner <rnk@google.com> | 2016-12-09 19:47:58 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-12-09 19:47:58 +0000 |
commit | 1a4ab7e77278f0dcb827451d54a47d6d272f8282 (patch) | |
tree | 1f9ca1855cad9ac3e247e6ac2ab06573abe3437c /clang/test/SemaTemplate/template-id-expr.cpp | |
parent | f0e87cf2c3dd9c45906fdc84eaae5e577dfb9829 (diff) | |
download | bcm5719-llvm-1a4ab7e77278f0dcb827451d54a47d6d272f8282.tar.gz bcm5719-llvm-1a4ab7e77278f0dcb827451d54a47d6d272f8282.zip |
Improve error message when referencing a non-tag type with a tag
Other compilers accept invalid code here that we reject, and we need a
better error message to try to convince users that the code is really
incorrect. Consider:
class Foo {
typedef MyIterHelper<Foo> iterator;
friend class iterator;
};
Previously our wording was "elaborated type refers to a typedef".
"elaborated type" isn't widely known terminology, so the new diagnostic
says "typedef 'iterator' cannot be referenced with class specifier".
Reviewers: rsmith
Differential Revision: https://reviews.llvm.org/D25216
llvm-svn: 289259
Diffstat (limited to 'clang/test/SemaTemplate/template-id-expr.cpp')
-rw-r--r-- | clang/test/SemaTemplate/template-id-expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/template-id-expr.cpp b/clang/test/SemaTemplate/template-id-expr.cpp index 499d289ee67..e311b5832d0 100644 --- a/clang/test/SemaTemplate/template-id-expr.cpp +++ b/clang/test/SemaTemplate/template-id-expr.cpp @@ -100,5 +100,5 @@ template void f5<0>(); // expected-note {{in instantiation of function template class C {}; template <template <typename> class D> // expected-note{{previous use is here}} class E { - template class D<C>; // expected-error {{elaborated type refers to a template template argument}} + template class D<C>; // expected-error {{template template argument 'D' cannot be referenced with a class specifier}} }; |