Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 1 | From f9150a0dc092ab2cbd47ee428436b747dce323a9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 23 Apr 2017 10:28:28 -0700 |
| 4 | Subject: [PATCH] SquidNew: use noexcept instead of throw for C++11 compilers |
| 5 | |
| 6 | Fixes errors with gcc7 which is more pedantic about c++11 |
| 7 | conformance regarding deprecated features |
| 8 | |
| 9 | include/SquidNew.h:21:51: error: dynamic exception specifications are deprecated in C++11 |
| 10 | _SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc) |
| 11 | ^~~~~ |
| 12 | |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | include/SquidNew.h | 8 ++++---- |
| 16 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 17 | |
| 18 | diff --git a/include/SquidNew.h b/include/SquidNew.h |
| 19 | index 39fcee0..c960347 100644 |
| 20 | --- a/include/SquidNew.h |
| 21 | +++ b/include/SquidNew.h |
| 22 | @@ -18,19 +18,19 @@ |
| 23 | */ |
| 24 | #include <new> |
| 25 | |
| 26 | -_SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc) |
| 27 | +_SQUID_EXTERNNEW_ void *operator new(size_t size) noexcept(false) |
| 28 | { |
| 29 | return xmalloc(size); |
| 30 | } |
| 31 | -_SQUID_EXTERNNEW_ void operator delete (void *address) throw() |
| 32 | +_SQUID_EXTERNNEW_ void operator delete (void *address) noexcept(true) |
| 33 | { |
| 34 | xfree(address); |
| 35 | } |
| 36 | -_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc) |
| 37 | +_SQUID_EXTERNNEW_ void *operator new[] (size_t size) noexcept(false) |
| 38 | { |
| 39 | return xmalloc(size); |
| 40 | } |
| 41 | -_SQUID_EXTERNNEW_ void operator delete[] (void *address) throw() |
| 42 | +_SQUID_EXTERNNEW_ void operator delete[] (void *address) noexcept(true) |
| 43 | { |
| 44 | xfree(address); |
| 45 | } |
| 46 | -- |
| 47 | 2.12.2 |
| 48 | |