Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 27e10667bf27baf5f119a791e3473bb9435a786a Mon Sep 17 00:00:00 2001 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | --- |
| 16 | include/SquidNew.h | 8 ++++---- |
| 17 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 18 | |
| 19 | diff --git a/include/SquidNew.h b/include/SquidNew.h |
| 20 | index 39fcee0..c960347 100644 |
| 21 | --- a/include/SquidNew.h |
| 22 | +++ b/include/SquidNew.h |
| 23 | @@ -18,19 +18,19 @@ |
| 24 | */ |
| 25 | #include <new> |
| 26 | |
| 27 | -_SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc) |
| 28 | +_SQUID_EXTERNNEW_ void *operator new(size_t size) noexcept(false) |
| 29 | { |
| 30 | return xmalloc(size); |
| 31 | } |
| 32 | -_SQUID_EXTERNNEW_ void operator delete (void *address) throw() |
| 33 | +_SQUID_EXTERNNEW_ void operator delete (void *address) noexcept(true) |
| 34 | { |
| 35 | xfree(address); |
| 36 | } |
| 37 | -_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc) |
| 38 | +_SQUID_EXTERNNEW_ void *operator new[] (size_t size) noexcept(false) |
| 39 | { |
| 40 | return xmalloc(size); |
| 41 | } |
| 42 | -_SQUID_EXTERNNEW_ void operator delete[] (void *address) throw() |
| 43 | +_SQUID_EXTERNNEW_ void operator delete[] (void *address) noexcept(true) |
| 44 | { |
| 45 | xfree(address); |
| 46 | } |