[libcxx] r289355 - Fix count_new.hpp to work w/o dynamic exception specifications
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 10 18:20:17 PST 2016
Author: ericwf
Date: Sat Dec 10 20:20:17 2016
New Revision: 289355
URL: http://llvm.org/viewvc/llvm-project?rev=289355&view=rev
Log:
Fix count_new.hpp to work w/o dynamic exception specifications
Modified:
libcxx/trunk/test/support/count_new.hpp
Modified: libcxx/trunk/test/support/count_new.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/count_new.hpp?rev=289355&r1=289354&r2=289355&view=diff
==============================================================================
--- libcxx/trunk/test/support/count_new.hpp (original)
+++ libcxx/trunk/test/support/count_new.hpp Sat Dec 10 20:20:17 2016
@@ -234,7 +234,10 @@ public:
MemCounter globalMemCounter((MemCounter::MemCounterCtorArg_()));
#ifndef DISABLE_NEW_COUNT
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s)
+#if TEST_STD_VER < 11
+ throw(std::bad_alloc)
+#endif
{
globalMemCounter.newCalled(s);
void* ret = std::malloc(s);
@@ -243,21 +246,34 @@ void* operator new(std::size_t s) throw(
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p)
+#if TEST_STD_VER < 11
+ throw()
+#else
+ noexcept
+#endif
{
globalMemCounter.deleteCalled(p);
std::free(p);
}
-void* operator new[](std::size_t s) throw(std::bad_alloc)
+void* operator new[](std::size_t s)
+#if TEST_STD_VER < 11
+ throw(std::bad_alloc)
+#endif
{
globalMemCounter.newArrayCalled(s);
return operator new(s);
}
-void operator delete[](void* p) throw()
+void operator delete[](void* p)
+#if TEST_STD_VER < 11
+ throw()
+#else
+ noexcept
+#endif
{
globalMemCounter.deleteArrayCalled(p);
operator delete(p);
More information about the cfe-commits
mailing list