From: Jonathan Wakely Date: Tue, 20 Aug 2024 20:47:29 +0000 (+0100) Subject: libstdc++: Adjust testcase for constexpr placement new [PR115744] X-Git-Tag: basepoints/gcc-16~6504 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20c63093db0f230ef49a298cdb0611f38e470203;p=thirdparty%2Fgcc.git libstdc++: Adjust testcase for constexpr placement new [PR115744] This test now fails in C++26 mode because the declaration in is constexpr and the one in the test isn't. Add constexpr to the test. libstdc++-v3/ChangeLog: PR libstdc++/115744 * testsuite/18_support/headers/new/synopsis.cc [C++26]: Add constexpr to placement operator new and operator new[]. --- diff --git a/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc index 5c83956b5845..479f0df12b5d 100644 --- a/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc +++ b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc @@ -46,8 +46,13 @@ void* operator new[](std::size_t size, const std::nothrow_t&) throw(); void operator delete[](void* ptr) throw(); void operator delete[](void* ptr, const std::nothrow_t&) throw(); -void* operator new (std::size_t size, void* ptr) throw(); -void* operator new[](std::size_t size, void* ptr) throw(); +#if __cplusplus > 202302L +# define CXX26_CONSTEXPR constexpr +#else +# define CXX26_CONSTEXPR +#endif +CXX26_CONSTEXPR void* operator new (std::size_t size, void* ptr) throw(); +CXX26_CONSTEXPR void* operator new[](std::size_t size, void* ptr) throw(); void operator delete (void* ptr, void*) throw(); void operator delete[](void* ptr, void*) throw();