PR c++/67913 - new expression with negative size not diagnosed
PR c++/67913 - new expression with negative size not diagnosed PR c++/67927 - array new expression with excessive number of elements not diagnosed gcc/cp/ * call.c (build_operator_new_call): Do not assume size_check is non-null, analogously to the top half of the function. * init.c (build_new_1): Detect and diagnose array sizes in excess of the maximum of roughly SIZE_MAX / 2. Insert a runtime check only for arrays with a non-constant size. (build_new): Detect and diagnose negative array sizes. gcc/testsuite/ * init/new45.C: New test to verify that operator new is invoked with or without overhead for a cookie. * init/new44.C: New test for placement new expressions for arrays with excessive number of elements. * init/new43.C: New test for placement new expressions for arrays with negative number of elements. * other/new-size-type.C: Expect array new expression with an excessive number of elements to be rejected. From-SVN: r230081
Showing
gcc/testsuite/g++.dg/init/new43.C
0 → 100644
gcc/testsuite/g++.dg/init/new44.C
0 → 100644
This diff is collapsed.
Click to expand it.
gcc/testsuite/g++.dg/init/new45.C
0 → 100644
Please
register
or
sign in
to comment