summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-12-01 11:06:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-12-02 08:02:21 +0100
commitb3e1b52252e7b1a807504d9bbdf88a58d6325d0b (patch)
treed85c16d32cf62d9cba39201d36f7b56a16b6d6ff /sal
parent803bff584c1c6861e33a91f5075ba68a089a8c8e (diff)
Adapt new/delete exception specs for MSVC
...where plain operator new/delete are reportedly predefined (cf. <www.geoffchappell.com/studies/msvc/language/predefined/index.html>) without any exception specs, then redeclared in C:/PROGRA~2/MICROS~1.0/VC/include/new with exception specs that are ignored by MSVC (so it presumably doesn't even complain about the mismatching redeclarations, just effectively ignores them); and array operator new/delete are declared in C:/PROGRA~2/MICROS~1.0/VC/include/crtdbg.h without any exception specs. clang-cl would warn about those inconsistencies. Change-Id: I4dd15e4cfcedc3de5e8617b43769b5371cafa71f
Diffstat (limited to 'sal')
-rw-r--r--sal/cpprt/operators_new_delete.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sal/cpprt/operators_new_delete.cxx b/sal/cpprt/operators_new_delete.cxx
index 13491bd3889f..8cf69ff07196 100644
--- a/sal/cpprt/operators_new_delete.cxx
+++ b/sal/cpprt/operators_new_delete.cxx
@@ -145,7 +145,10 @@ static void deallocate (void * p, AllocatorTraits const & rTraits)
// T * p = new T; delete p;
-void* SAL_CALL operator new (std::size_t n) throw (std::bad_alloc)
+void* SAL_CALL operator new (std::size_t n)
+#if !defined _MSC_VER
+ throw (std::bad_alloc)
+#endif
{
return allocate (n, ScalarTraits());
}
@@ -188,7 +191,10 @@ void* SAL_CALL operator new[] (std::size_t n) throw (std::bad_alloc)
return allocate (n, VectorTraits());
}
-void SAL_CALL operator delete[] (void * p) throw ()
+void SAL_CALL operator delete[] (void * p)
+#if !defined _MSC_VER
+ throw ()
+#endif
{
deallocate (p, VectorTraits());
}