]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
tests: Remove exception specifications
authorBart Van Assche <bvanassche@acm.org>
Thu, 11 May 2017 03:07:11 +0000 (03:07 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 11 May 2017 03:07:11 +0000 (03:07 +0000)
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
memcheck/tests/new_override.cpp

index 6c61d8e1d5efa59994af0c9512f1191022363b6f..8fb87078b65e15ec74c9c11a1c640eb76584d8a6 100644 (file)
@@ -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);
 }
index 200173617c2fee8038d70f37363192b4735da713..f462a9cccd90443ad34a2e02bbf82573c622cbce 100644 (file)
@@ -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");