From 2393a4c5ca045a0a3786320bf610f85b4dfb59c0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 11 May 2017 03:07:11 +0000 Subject: [PATCH] tests: Remove exception specifications Exception specifications are a deprecated feature in C++11 and gcc 7 complains about these specifications. Hence remove these specifications. This patch avoids that gcc reports the following: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16360 --- massif/tests/overloaded-new.cpp | 12 ++++++------ memcheck/tests/new_override.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/massif/tests/overloaded-new.cpp b/massif/tests/overloaded-new.cpp index 6c61d8e1d..8fb87078b 100644 --- a/massif/tests/overloaded-new.cpp +++ b/massif/tests/overloaded-new.cpp @@ -14,32 +14,32 @@ typedef struct { int array[1000]; } s; -__attribute__((noinline)) void* operator new (std::size_t n) throw (std::bad_alloc) +__attribute__((noinline)) void* operator new (std::size_t n) { return malloc(n); } -__attribute__((noinline)) void* operator new (std::size_t n, std::nothrow_t const &) throw () +__attribute__((noinline)) void* operator new (std::size_t n, std::nothrow_t const &) { return malloc(n); } -__attribute__((noinline)) void* operator new[] (std::size_t n) throw (std::bad_alloc) +__attribute__((noinline)) void* operator new[] (std::size_t n) { return malloc(n); } -__attribute__((noinline)) void* operator new[] (std::size_t n, std::nothrow_t const &) throw () +__attribute__((noinline)) void* operator new[] (std::size_t n, std::nothrow_t const &) { return malloc(n); } -__attribute__((noinline)) void operator delete (void* p) throw() +__attribute__((noinline)) void operator delete (void* p) { return free(p); } -__attribute__((noinline)) void operator delete[] (void* p) throw() +__attribute__((noinline)) void operator delete[] (void* p) { return free(p); } diff --git a/memcheck/tests/new_override.cpp b/memcheck/tests/new_override.cpp index 200173617..f462a9ccc 100644 --- a/memcheck/tests/new_override.cpp +++ b/memcheck/tests/new_override.cpp @@ -7,7 +7,7 @@ public: int a, b, c, d; }; -void *operator new[](size_t size) throw(std::bad_alloc) +void *operator new[](size_t size) { void *ret = malloc(size); printf("Here.\n"); -- 2.11.4.GIT