summaryrefslogtreecommitdiff
path: root/sci-chemistry/sparky/files/3.115-fix-c++14.patch
blob: 3a05ea7d85ce9a94116ced52966d88d1bc953857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)