diff options
Diffstat (limited to 'test/SemaTemplate/dependent-type-identity.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-type-identity.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-type-identity.cpp b/test/SemaTemplate/dependent-type-identity.cpp index 731013c86387..a796834ce01a 100644 --- a/test/SemaTemplate/dependent-type-identity.cpp +++ b/test/SemaTemplate/dependent-type-identity.cpp @@ -98,3 +98,27 @@ namespace PR7460 { template <typename T> T TemplateClass2<T>::member[TemplateClass2<T>::SIZE]; } + +namespace PR18275 { + template<typename T> struct A { + void f(const int); + void g(int); + void h(const T); + void i(T); + }; + + template<typename T> + void A<T>::f(int x) { x = 0; } + + template<typename T> + void A<T>::g(const int x) { x = 0; } // expected-error {{not assignable}} + + template<typename T> + void A<T>::h(T) {} // FIXME: Should reject this. Type is different from prior decl if T is an array type. + + template<typename T> + void A<T>::i(const T) {} // FIXME: Should reject this. Type is different from prior decl if T is an array type. + + template struct A<int>; + template struct A<int[1]>; +} |