aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-08-20 21:47:29 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-08-20 21:51:50 +0100
commit20c63093db0f230ef49a298cdb0611f38e470203 (patch)
tree533cb1696973d5c9652cd95ab7484683ff55c120
parent447c32c5142a60278230f81ae6e50e41ef6d988e (diff)
downloadgcc-20c63093db0f230ef49a298cdb0611f38e470203.zip
gcc-20c63093db0f230ef49a298cdb0611f38e470203.tar.gz
gcc-20c63093db0f230ef49a298cdb0611f38e470203.tar.bz2
libstdc++: Adjust testcase for constexpr placement new [PR115744]
This test now fails in C++26 mode because the declaration in <new> 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[].
-rw-r--r--libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc
index 5c83956..479f0df 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();