Re: [pushed] c++: Fix constexpr array ICE [PR98332]

2020-12-23 Thread Jason Merrill via Gcc-patches
On 12/23/20 4:43 PM, Jakub Jelinek wrote: On Wed, Dec 23, 2020 at 04:40:29PM -0500, Jason Merrill via Gcc-patches wrote: diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow3.C new file mode 100644 index 000..22d4c59f4f8 --- /dev/

Re: [pushed] c++: Fix constexpr array ICE [PR98332]

2020-12-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 23, 2020 at 04:40:29PM -0500, Jason Merrill via Gcc-patches wrote: > diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow3.C > b/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow3.C > new file mode 100644 > index 000..22d4c59f4f8 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/c

[pushed] c++: Fix constexpr array ICE [PR98332]

2020-12-23 Thread Jason Merrill via Gcc-patches
The element initializer was non-constant, so its CONSTRUCTOR element ended up NULL, so unshare_constructor crashed trying to look at it. This patch fixes this in two places: First, by returning when we see a non-constant initializer; second, by not crashing on NULL. Tested x86_64-pc-linux-gnu, ap