diff options
author | Jan Korous <jkorous@apple.com> | 2018-02-08 14:37:58 +0000 |
---|---|---|
committer | Jan Korous <jkorous@apple.com> | 2018-02-08 14:37:58 +0000 |
commit | 9a33e2aa22f4fef55be8c7474cd19bf8538116ef (patch) | |
tree | 4614ca068d146607a9bcdcf91a15fa738100707c /test/CXX | |
parent | 65ae7c117df699753a3b9439ea3f6f55e05f0e0c (diff) |
[Parser][FixIt] Better diagnostics for "typedef" instead of "typename" typo
rdar://problem/10214588
Differential Revision: https://reviews.llvm.org/D42170
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/temp/temp.param/p2.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/CXX/temp/temp.param/p2.cpp b/test/CXX/temp/temp.param/p2.cpp index 20e0b8ef35..656bd26ff0 100644 --- a/test/CXX/temp/temp.param/p2.cpp +++ b/test/CXX/temp/temp.param/p2.cpp @@ -15,29 +15,29 @@ template<typename T, typename X<T>::type Value> struct Y1; // A storage class shall not be specified in a template-parameter declaration. template<static int Value> struct Z; //expected-error{{invalid declaration specifier}} -template<typedef int Value> struct Z0; //expected-error{{invalid declaration specifier}} -template<extern inline int Value> struct Z0; //expected-error2{{invalid declaration specifier}} -template<virtual int Value> struct Z0; //expected-error{{invalid declaration specifier}} -template<explicit int Value> struct Z0; //expected-error{{invalid declaration specifier}} -template<inline int Value> struct Z0; //expected-error{{invalid declaration specifier}} -template<extern int> struct Z0; //expected-error{{invalid declaration specifier}} -template<static int> struct Z0; //expected-error{{invalid declaration specifier}} -template<explicit int Value> struct Z0; //expected-error{{invalid declaration specifier}} -template<mutable int> struct Z0; //expected-error{{invalid declaration specifier}} +template<typedef int Value> struct Z0; //expected-error{{expected template parameter}} expected-error{{expected identifier}} expected-error{{extraneous 'template<>' in declaration of struct 'Z0'}} expected-note{{did you mean to use 'typename'?}} +template<extern inline int Value> struct Z1; //expected-error2{{invalid declaration specifier}} +template<virtual int Value> struct Z2; //expected-error{{invalid declaration specifier}} +template<explicit int Value> struct Z3; //expected-error{{invalid declaration specifier}} +template<inline int Value> struct Z4; //expected-error{{invalid declaration specifier}} +template<extern int> struct Z5; //expected-error{{invalid declaration specifier}} +template<static int> struct Z6; //expected-error{{invalid declaration specifier}} +template<explicit int Value> struct Z7; //expected-error{{invalid declaration specifier}} +template<mutable int> struct Z8; //expected-error{{invalid declaration specifier}} -template<const int> struct Z0; // OK -template<volatile int> struct Z0; // OK +template<const int> struct Z9; // OK +template<volatile int> struct Z10; // OK #ifdef CPP11 -template<thread_local int> struct Z0; //expected-error{{invalid declaration specifier}} -template<constexpr int> struct Z0; //expected-error{{invalid declaration specifier}} +template<thread_local int> struct Z11; //expected-error{{invalid declaration specifier}} +template<constexpr int> struct Z12; //expected-error{{invalid declaration specifier}} #endif #ifdef CPP17 -template<auto> struct Z1; // OK +template<auto> struct Z13; // OK #endif // Make sure that we properly disambiguate non-type template parameters that |