https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100456
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- That is an intentional change, not a bug: c++: C++20 DR 2237, disallow simple-template-id in cdtor. This patch implements DR 2237 which says that a simple-template-id is no longer valid as the declarator-id of a constructor or destructor; see [diff.cpp17.class]#2. It is not explicitly stated but out-of-line destructors with a simple-template-id are also meant to be ill-formed now. (Out-of-line constructors like that are invalid since DR1435 I think.) This change only applies to C++20; it is not a DR against C++17. I'm not crazy about the diagnostic in constructors but ISTM that cp_parser_constructor_declarator_p shouldn't print errors. See g:4b38d56dbac6742b038551a36ec80200313123a1 GCC is correct to reject the code.