diff options
Diffstat (limited to 'sal/cpprt')
-rw-r--r-- | sal/cpprt/operators_new_delete.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sal/cpprt/operators_new_delete.cxx b/sal/cpprt/operators_new_delete.cxx index 064caa5946f5..5fbd9c09be7d 100644 --- a/sal/cpprt/operators_new_delete.cxx +++ b/sal/cpprt/operators_new_delete.cxx @@ -18,8 +18,11 @@ */ #include <algorithm> +#include <cstddef> #include <new> #include <string.h> + +#include <config_global.h> #include <osl/diagnose.h> #include <rtl/alloc.h> @@ -152,6 +155,20 @@ void SAL_CALL operator delete (void * p) throw () deallocate (p, ScalarTraits()); } +#if HAVE_CXX14_SIZED_DEALLOCATION +#if defined __clang__ +#pragma GCC diagnostic push // as happens on Mac OS X: +#pragma GCC diagnostic ignored "-Wimplicit-exception-spec-mismatch" +#endif +void SAL_CALL operator delete (void * p, std::size_t) noexcept +{ + deallocate (p, ScalarTraits()); +} +#if defined __clang__ +#pragma GCC diagnostic pop +#endif +#endif + // T * p = new(nothrow) T; delete(nothrow) p; void* SAL_CALL operator new (std::size_t n, std::nothrow_t const &) throw () @@ -176,6 +193,20 @@ void SAL_CALL operator delete[] (void * p) throw () deallocate (p, VectorTraits()); } +#if HAVE_CXX14_SIZED_DEALLOCATION +#if defined __clang__ +#pragma GCC diagnostic push // as happens on Mac OS X: +#pragma GCC diagnostic ignored "-Wimplicit-exception-spec-mismatch" +#endif +void SAL_CALL operator delete[] (void * p, std::size_t) noexcept +{ + deallocate (p, VectorTraits()); +} +#if defined __clang__ +#pragma GCC diagnostic pop +#endif +#endif + // T * p = new(nothrow) T[n]; delete(nothrow)[] p; void* SAL_CALL operator new[] (std::size_t n, std::nothrow_t const &) throw () |