Kaydet (Commit) b3e1b522 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 803bff58
......@@ -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());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment