Daily bump.
[official-gcc.git] / gcc / testsuite / g++.dg / DRs / dr2237.C
blob830c8f5a2a6477ae555c6466979fba14838374db
1 // DR 2237 - Can a template-id name a constructor?
3 template<class T>
4 struct X {
5   X<T>(); // { dg-error "template-id not allowed for constructor" "" { target c++20 } }
6   X(int); // OK, injected-class-name used
7   ~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
8 };
10 // ill-formed since DR1435
11 template<typename T> X<T>::X<T>() {} // { dg-error "names the constructor|as no template constructors" }
12 template<typename T> X<T>::~X<T>() {} // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
14 struct Q {
15   // ill-formed since DR1435
16   template<typename T> friend X<T>::X<T>(); // { dg-error "names the constructor|as no template constructors" }
17   template<typename T> friend X<T>::~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }