https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104437
Bug ID: 104437
Summary: Constructor of templated class with full instantiation
name rejected in -std=c++2a
Product: gcc
Version: 11.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jengelh at inai dot de
Target Milestone: ---
Input
=====
struct K {};
template<typename Base> struct S : Base {
S<Base>() {}
};
int main() { S<K> s; }
Output
======
$ g++ -c -std=c++2a x.cpp (-v)
gcc version 11.2.1 20220103 [revision d4a1d3c4b377f1d4acb34fe1b55b5088a3f293f6]
(SUSE Linux)
x.cpp:3:17: error: expected unqualified-id before ‘)’ token
3 | S<Base>() {}
Expected output
===============
One of two options.
(a) succeed, as it does with g++ -std=c++17 (clang13 also accepts it under both
-std=).
(b) improve the error message to hint that the current instantiation of a class
template is no longer accepted in the new standard.