blob: 3a05ea7d85ce9a94116ced52966d88d1bc953857 [file] [log] [blame]
Fix the custom new/new[] operators in order to account for changed
noexcept semantics in C++11.
See also: https://bugs.gentoo.org/show_bug.cgi?id=596012
Patch by Peter Levine
--- a/c++/memalloc.cc
+++ b/c++/memalloc.cc
@@ -39,7 +39,10 @@
// ----------------------------------------------------------------------------
//
-void *operator new(size_t size) throw(std::bad_alloc)
+void *operator new(size_t size)
+#if __cplusplus < 201103L
+throw(std::bad_alloc)
+#endif
{
void *value = allocate(size);
if (tracking_memory)
@@ -72,7 +75,10 @@
// ----------------------------------------------------------------------------
//
-void *operator new[](size_t size) throw(std::bad_alloc)
+void *operator new[](size_t size)
+#if __cplusplus < 201103L
+throw(std::bad_alloc)
+#endif
{
void *value = allocate(size);
if (tracking_memory)