Re: [PATCH] c++: Fix array new with value-initialization [PR97523]

2020-11-19 Thread Jason Merrill via Gcc-patches
On 11/19/20 11:11 AM, Marek Polacek wrote: Since my r11-3092 the following is rejected with -std=c++20: struct T { explicit T(); }; void fn(int n) { new T[1](); } with "would use explicit constructor 'T::T()'". It is because since that change we go into the P1009 block in build_n

[PATCH] c++: Fix array new with value-initialization [PR97523]

2020-11-19 Thread Marek Polacek via Gcc-patches
Since my r11-3092 the following is rejected with -std=c++20: struct T { explicit T(); }; void fn(int n) { new T[1](); } with "would use explicit constructor 'T::T()'". It is because since that change we go into the P1009 block in build_new (array_p is false, but nelts is non-null and w