https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97523
Bug ID: 97523 Summary: [11 Regression] bogus "would use explicit constructor" error for new[]() Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- Since my r11-3092 the following is rejected with -std=c++20: template <typename> struct A; template <typename T> struct A<T[]> { typedef T type; }; template <typename T> using U = typename A<T>::type; struct B { template <typename T> B(T); }; long int sz; template <typename T> void foo() { new U<T>[sz](); } struct D { explicit D(); }; struct C { B b; C() : b(foo<D[]>) {} }; r.cc: In instantiation of ‘void foo() [with T = D []]’: r.cc:19:9: required from here r.cc:11:36: error: converting to ‘U<D []>’ {aka ‘D’} from initializer list would use explicit constructor ‘D::D()’ 11 | template <typename T> void foo() { new U<T>[sz](); } |