// DR 2237 - Can a template-id name a constructor? template struct X { X(); // { dg-error "template-id not allowed for constructor" "" { target c++20 } } X(int); // OK, injected-class-name used ~X(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } } }; // ill-formed since DR1435 template X::X() {} // { dg-error "names the constructor|as no template constructors" } template X::~X() {} // { dg-error "template-id not allowed for destructor" "" { target c++20 } } struct Q { // ill-formed since DR1435 template friend X::X(); // { dg-error "names the constructor|as no template constructors" } template friend X::~X(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } } };