]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/other/new-size-type.C
PR c++/87996 - size of array is negative error when SIZE_MAX/2 < sizeof(array) <...
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / other / new-size-type.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin: PR c++/36741
3
4 #include <stddef.h>
5 const char*
6 foo()
7 {
8 return new char[~static_cast<size_t>(0)];// { dg-error "exceeds maximum object size" }
9 }