[mlir] Fix typo in test vector transform pass descriptions (#118194)
[llvm-project.git] / clang / test / SemaCXX / PR28101.cpp
blob311c0f0db8174a8b3d74bea1f57877f0c38b01d6
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
3 template <typename T> struct A {
4 A(void *) {}
5 T(A<T>){}; // expected-error{{member 'A' cannot have template arguments}}\
6 // expected-error2{{member 'A' has the same name as its class}}
7 };
8 // Don't crash.
9 A<int> instantiate1() { return {nullptr}; } // expected-note{{in instantiation of template class 'A<int>' requested here}}
11 template <typename T> struct B {
12 B(void *) {}
13 T B<T>{}; // expected-error{{member 'B' cannot have template arguments}}\
14 // expected-error2{{member 'B' has the same name as its class}}
16 // Don't crash.
17 B<int> instantiate2() { return {nullptr}; } // expected-note{{in instantiation of template class 'B<int>' requested here}}
19 template <typename T> struct S {};
21 template <typename T> struct C {
22 C(void *) {}
23 T S<T>{}; // expected-error{{member 'S' cannot have template arguments}}
25 // Don't crash.
26 C<int> instantiate3() { return {nullptr}; }
28 template <typename T, template <typename> typename U> class D {
29 public:
30 D(void *) {}
31 T(D<T, U<T>>) {} // expected-error{{member 'D' cannot have template arguments}}\
32 // expected-error{{expected ';' at end of declaration list}}\
33 // expected-error2{{member 'D' has the same name as its class}}
35 // Don't crash.
36 D<int, S> instantiate4() { return D<int, S>(nullptr); } // expected-note{{in instantiation of template class 'D<int, S>' requested here}}