]> git.ipfire.org Git - thirdparty/gcc.git/blame - 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
CommitLineData
38921d27 1// Contributed by Dodji Seketeli <dodji@redhat.com>
2// Origin: PR c++/36741
3
4#include <stddef.h>
5const char*
6foo()
7{
08acf739 8 return new char[~static_cast<size_t>(0)];// { dg-error "exceeds maximum object size" }
38921d27 9}