From: Ivan Maidanski Date: Wed, 6 Jun 2018 06:14:03 +0000 (+0300) Subject: Workaround 'dynamic exception specifications deprecated in C++11' warning X-Git-Tag: v8.0.0~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e965562c;p=gc Workaround 'dynamic exception specifications deprecated in C++11' warning (fix of commit cb1194d17) * include/gc_cpp.h [GC_NEW_DELETE_NEED_THROW && __cplusplus>=201103L && !__clang__] (GC_DECL_NEW_THROW, GC_DECL_DELETE_THROW): Define to empty. --- diff --git a/include/gc_cpp.h b/include/gc_cpp.h index e5f770db..dc54d1ac 100644 --- a/include/gc_cpp.h +++ b/include/gc_cpp.h @@ -182,8 +182,13 @@ by UseGC. GC is an alias for UseGC, unless GC_NAME_CONFLICT is defined. #ifdef GC_NEW_DELETE_NEED_THROW # include /* for std::bad_alloc */ -# define GC_DECL_NEW_THROW throw(std::bad_alloc) -# define GC_DECL_DELETE_THROW throw() +# if __cplusplus >= 201103L && !defined(__clang__) +# define GC_DECL_NEW_THROW /* empty */ +# define GC_DECL_DELETE_THROW /* empty */ +# else +# define GC_DECL_NEW_THROW throw(std::bad_alloc) +# define GC_DECL_DELETE_THROW throw() +# endif # define GC_OP_NEW_OOM_CHECK(obj) \ do { if (!(obj)) throw std::bad_alloc(); } while (0) #else