Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/DRs/dr2237.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // DR 2237 - Can a template-id name a constructor? | |
2 | |
3 template<class T> | |
4 struct X { | |
5 X<T>(); // { dg-error "expected" "" { 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 }; | |
9 | |
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 } } | |
13 | |
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 } } | |
18 }; |