diff options
author | Marek Polacek <polacek@redhat.com> | 2023-01-18 14:51:59 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2023-01-18 16:49:57 -0500 |
commit | 0f85ae6591c92b161693073c0931c7ca1d5d0c5a (patch) | |
tree | ccbdeeb12858685e825db52f7c7f9e27d418d0df /gcc/selftest.h | |
parent | 33237e93d59ee7bb215cd5b726880bcbd679bb36 (diff) | |
download | gcc-0f85ae6591c92b161693073c0931c7ca1d5d0c5a.zip gcc-0f85ae6591c92b161693073c0931c7ca1d5d0c5a.tar.gz gcc-0f85ae6591c92b161693073c0931c7ca1d5d0c5a.tar.bz2 |
c: ICE with nullptr as case expression [PR108424]
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" contexts as well.
PR c/108424
gcc/c-family/ChangeLog:
* c-common.cc (check_case_value): Check INTEGRAL_TYPE_P.
gcc/testsuite/ChangeLog:
* gcc.dg/c2x-nullptr-6.c: New test.
Diffstat (limited to 'gcc/selftest.h')
0 files changed, 0 insertions, 0 deletions