From: Martin Sebor Date: Thu, 8 Jul 2021 22:02:01 +0000 (-0600) Subject: Avoid including to make cross-compiler testing easy. X-Git-Tag: basepoints/gcc-13~6138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c68cac900ab4ccaf6b1a31168bc9a302ebc46428;p=thirdparty%2Fgcc.git Avoid including to make cross-compiler testing easy. gcc/testsuite/ChangeLog: * g++.dg/warn/Warray-bounds-11.C: Avoid including . * g++.dg/warn/Warray-bounds-13.C: Same. --- diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C index 70b39122f78a..9670898770fa 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C @@ -4,7 +4,24 @@ { dg-do compile } { dg-options "-O2 -Wall -Warray-bounds -ftrack-macro-expansion=0" } */ -#include +#if 0 +// Avoid including to make cross-compiler testing easy. +// #include +#else +namespace std { + +typedef __SIZE_TYPE__ size_t; +struct nothrow_t { }; +extern const nothrow_t nothrow; + +} + +void* operator new (std::size_t, const std::nothrow_t &) throw () + __attribute__ ((__alloc_size__ (1), __malloc__)); +void* operator new[] (std::size_t, const std::nothrow_t &) throw () + __attribute__ ((__alloc_size__ (1), __malloc__)); + +#endif typedef __INT32_TYPE__ int32_t; diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C index 2d3e9dcfd684..449324a315d0 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C @@ -4,7 +4,24 @@ { dg-do compile } { dg-options "-O2 -Wall -Warray-bounds -ftrack-macro-expansion=0" } */ -#include +#if 0 +// Avoid including to make cross-compiler testing easy. +// #include +#else +namespace std { + +typedef __SIZE_TYPE__ size_t; +struct nothrow_t { }; +extern const nothrow_t nothrow; + +} + +void* operator new (std::size_t, const std::nothrow_t &) throw () + __attribute__ ((__alloc_size__ (1), __malloc__)); +void* operator new[] (std::size_t, const std::nothrow_t &) throw () + __attribute__ ((__alloc_size__ (1), __malloc__)); + +#endif typedef __INT32_TYPE__ int32_t;