Fix more uses of dynamic exception specifications in C++17

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-12-11 02:47:36 +00:00
parent b61c998ece
commit e5bca2ba66
21 changed files with 110 additions and 85 deletions

View File

@@ -234,10 +234,7 @@ public:
MemCounter globalMemCounter((MemCounter::MemCounterCtorArg_()));
#ifndef DISABLE_NEW_COUNT
void* operator new(std::size_t s)
#if TEST_STD_VER < 11
throw(std::bad_alloc)
#endif
void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
globalMemCounter.newCalled(s);
void* ret = std::malloc(s);
@@ -246,34 +243,21 @@ void* operator new(std::size_t s)
return ret;
}
void operator delete(void* p)
#if TEST_STD_VER < 11
throw()
#else
noexcept
#endif
void operator delete(void* p) TEST_NOEXCEPT
{
globalMemCounter.deleteCalled(p);
std::free(p);
}
void* operator new[](std::size_t s)
#if TEST_STD_VER < 11
throw(std::bad_alloc)
#endif
void* operator new[](std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
globalMemCounter.newArrayCalled(s);
return operator new(s);
}
void operator delete[](void* p)
#if TEST_STD_VER < 11
throw()
#else
noexcept
#endif
void operator delete[](void* p) TEST_NOEXCEPT
{
globalMemCounter.deleteArrayCalled(p);
operator delete(p);