Re: [PATCH] c: ICE with nullptr as case expression [PR108424]

2023-01-18 Thread Joseph Myers
On Wed, 18 Jan 2023, Marek Polacek via Gcc-patches wrote: > In this ICE-on-invalid, we crash on > > gcc_assert (INTEGRAL_TYPE_P (type)); > > in perform_integral_promotions, because a nullptr is an INTEGER_CST, > but not INTEGRAL_TYPE_P, and check_case_value is only checking the > former. In t

[PATCH] c: ICE with nullptr as case expression [PR108424]

2023-01-18 Thread Marek Polacek via Gcc-patches
In this ICE-on-invalid, we crash on gcc_assert (INTEGRAL_TYPE_P (type)); in perform_integral_promotions, because a nullptr is an INTEGER_CST, but not INTEGRAL_TYPE_P, and check_case_value is only checking the former. In the test I'm testing other "shall be an integral constant expression" cont