PR c++/97201 - ICE in -Warray-bounds writing to result of operator new(0)
authorMartin Sebor <msebor@redhat.com>
Mon, 12 Oct 2020 15:35:02 +0000 (09:35 -0600)
committerMartin Sebor <msebor@redhat.com>
Mon, 12 Oct 2020 15:36:26 +0000 (09:36 -0600)
commit1be51a3a9ac3409561223c8058d4943f9b574d15
treee332d3ec5e66c8e0c51b13b551a8e7fa182eafb2
parent83685efd5fd1623cfc4e4c435ce2773d95d458d1
PR c++/97201 - ICE in -Warray-bounds writing to result of operator new(0)

gcc/cp/ChangeLog:

PR c++/97201
* error.c (dump_type_suffix): Handle both the C and C++ forms of
zero-length arrays.

libstdc++-v3/ChangeLog:

PR c++/97201
* libsupc++/new (operator new): Add attribute alloc_size and malloc.

gcc/testsuite/ChangeLog:

PR c++/97201
* g++.dg/warn/Wplacement-new-size-8.C: Adjust expected message.
* g++.dg/warn/Warray-bounds-10.C: New test.
* g++.dg/warn/Warray-bounds-11.C: New test.
* g++.dg/warn/Warray-bounds-12.C: New test.
* g++.dg/warn/Warray-bounds-13.C: New test.
gcc/cp/error.c
gcc/testsuite/g++.dg/warn/Warray-bounds-10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Warray-bounds-11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Warray-bounds-12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Warray-bounds-13.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wplacement-new-size-8.C
libstdc++-v3/libsupc++/new