3.115-fix-c++14.patch 849 B

123456789101112131415161718192021222324252627282930313233
  1. Fix the custom new/new[] operators in order to account for changed
  2. noexcept semantics in C++11.
  3. See also: https://bugs.gentoo.org/show_bug.cgi?id=596012
  4. Patch by Peter Levine
  5. --- a/c++/memalloc.cc
  6. +++ b/c++/memalloc.cc
  7. @@ -39,7 +39,10 @@
  8. // ----------------------------------------------------------------------------
  9. //
  10. -void *operator new(size_t size) throw(std::bad_alloc)
  11. +void *operator new(size_t size)
  12. +#if __cplusplus < 201103L
  13. +throw(std::bad_alloc)
  14. +#endif
  15. {
  16. void *value = allocate(size);
  17. if (tracking_memory)
  18. @@ -72,7 +75,10 @@
  19. // ----------------------------------------------------------------------------
  20. //
  21. -void *operator new[](size_t size) throw(std::bad_alloc)
  22. +void *operator new[](size_t size)
  23. +#if __cplusplus < 201103L
  24. +throw(std::bad_alloc)
  25. +#endif
  26. {
  27. void *value = allocate(size);
  28. if (tracking_memory)