]> granicus.if.org Git - gc/commitdiff
Workaround 'dynamic exception specifications deprecated in C++11' warning
authorIvan Maidanski <ivmai@mail.ru>
Wed, 6 Jun 2018 06:14:03 +0000 (09:14 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 18 Jul 2018 05:54:37 +0000 (08:54 +0300)
(a cherry-pick of commit e965562c from 'master')

* gc_cpp.cc [GC_NEW_DELETE_NEED_THROW && __cplusplus>=201103L
&& !__clang__] (GC_DECL_NEW_THROW): Define to empty.

gc_cpp.cc

index 2b32e7aea76a7e8a26a188eb785434e5f886e6b3..6d6fbeb7ee7236e8c5822d8fe9f9b9472cb7f0a8 100644 (file)
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -36,7 +36,11 @@ built-in "new" and "delete".
 
 #ifdef GC_NEW_DELETE_NEED_THROW
 # include <new> /* for std::bad_alloc */
-# define GC_DECL_NEW_THROW throw(std::bad_alloc)
+# if (__cplusplus < 201103L || defined(__clang__))
+#   define GC_DECL_NEW_THROW throw(std::bad_alloc)
+# else
+#   define GC_DECL_NEW_THROW /* empty */
+# endif
 # define GC_DECL_DELETE_THROW throw()
 #else
 # define GC_DECL_NEW_THROW /* empty */