https://gcc.gnu.org/g:20c63093db0f230ef49a298cdb0611f38e470203

commit r15-3049-g20c63093db0f230ef49a298cdb0611f38e470203
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Aug 20 21:47:29 2024 +0100

    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[].

Diff:
---
 libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc | 9 +++++++--
 1 file 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 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();

Reply via email to