summaryrefslogtreecommitdiff
path: root/gc_cpp.cc
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-15 15:58:18 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-17 12:05:54 +0300
commit17364f0611fd147a5babc4258917b204ca88f586 (patch)
tree37b7137ecd6d7aa70e5d150c06e72f41eebd7eb2 /gc_cpp.cc
parent08eb0da6f5dbc9de1c0bf6e2ad7a7dedb24ac551 (diff)
downloadbdwgc-17364f0611fd147a5babc4258917b204ca88f586.tar.gz
Fix 'operator new is missing throw(bad_alloc)' clang warning in gc_cpp.h
The warning was reported on Window and only if __cplusplus < 201103L. * gc_cpp.cc [GC_NEW_DELETE_THROW_NOT_NEEDED && !GC_NEW_DELETE_NEED_THROW && GC_GNUC_PREREQ(4,2) && (__cplusplus<201103L || __clang__)] (GC_NEW_DELETE_NEED_THROW): Move definition to gc_cpp.h. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (GC_DECL_INLINE_NEW_THROW): New macro. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (operator new): Add GC_DECL_INLINE_NEW_THROW attribute.
Diffstat (limited to 'gc_cpp.cc')
-rw-r--r--gc_cpp.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/gc_cpp.cc b/gc_cpp.cc
index c046aafe..0600625a 100644
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -35,7 +35,7 @@ built-in "new" and "delete".
#include <new> // for std, bad_alloc; precedes include of gc_cpp.h
-#include "gc/gc_cpp.h" // for GC_OPERATOR_NEW_ARRAY
+#include "gc/gc_cpp.h"
#if !(defined(_MSC_VER) || defined(__DMC__)) || defined(GC_NO_INLINE_STD_NEW)
@@ -46,12 +46,6 @@ built-in "new" and "delete".
# define GC_ALLOCATOR_THROW_OR_ABORT() throw std::bad_alloc()
# endif
-# if !defined(GC_NEW_DELETE_THROW_NOT_NEEDED) \
- && !defined(GC_NEW_DELETE_NEED_THROW) && GC_GNUC_PREREQ(4, 2) \
- && (__cplusplus < 201103L || defined(__clang__))
-# define GC_NEW_DELETE_NEED_THROW
-# endif
-
# ifndef GC_NEW_DELETE_NEED_THROW
# define GC_DECL_NEW_THROW /* empty */
# elif __cplusplus >= 201703L || _MSVC_LANG >= 201703L