Update these declarations of operator delete (and delete[]) to have noexcept,
authorNick Lewycky <nicholas@mxc.ca>
Sat, 8 Feb 2014 01:29:07 +0000 (01:29 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 8 Feb 2014 01:29:07 +0000 (01:29 +0000)
as required per core issue 1552 and warned about with
-Wimplicit-exception-spec-mismatch.

llvm-svn: 201014

compiler-rt/lib/asan/asan_new_delete.cc
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc

index 78ef7b2..9b1f437 100644 (file)
@@ -81,15 +81,21 @@ INTERCEPTOR(void *, _ZnamRKSt9nothrow_t, size_t size, std::nothrow_t const&) {
 
 #if !SANITIZER_MAC
 INTERCEPTOR_ATTRIBUTE
-void operator delete(void *ptr) { OPERATOR_DELETE_BODY(FROM_NEW); }
+void operator delete(void *ptr) noexcept {
+  OPERATOR_DELETE_BODY(FROM_NEW);
+}
 INTERCEPTOR_ATTRIBUTE
-void operator delete[](void *ptr) { OPERATOR_DELETE_BODY(FROM_NEW_BR); }
+void operator delete[](void *ptr) noexcept {
+  OPERATOR_DELETE_BODY(FROM_NEW_BR);
+}
 INTERCEPTOR_ATTRIBUTE
-void operator delete(void *ptr, std::nothrow_t const&)
-{ OPERATOR_DELETE_BODY(FROM_NEW); }
+void operator delete(void *ptr, std::nothrow_t const&) {
+  OPERATOR_DELETE_BODY(FROM_NEW);
+}
 INTERCEPTOR_ATTRIBUTE
-void operator delete[](void *ptr, std::nothrow_t const&)
-{ OPERATOR_DELETE_BODY(FROM_NEW_BR); }
+void operator delete[](void *ptr, std::nothrow_t const&) {
+  OPERATOR_DELETE_BODY(FROM_NEW_BR);
+}
 
 #else  // SANITIZER_MAC
 INTERCEPTOR(void, _ZdlPv, void *ptr) {
index 5bb0f27..ea21031 100644 (file)
@@ -576,14 +576,14 @@ void *operator new[](__sanitizer::uptr size, std::nothrow_t const&) {
   user_free(thr, pc, ptr);
 
 SANITIZER_INTERFACE_ATTRIBUTE
-void operator delete(void *ptr);
-void operator delete(void *ptr) {
+void operator delete(void *ptr) noexcept;
+void operator delete(void *ptr) noexcept {
   OPERATOR_DELETE_BODY(_ZdlPv);
 }
 
 SANITIZER_INTERFACE_ATTRIBUTE
-void operator delete[](void *ptr);
-void operator delete[](void *ptr) {
+void operator delete[](void *ptr) noexcept;
+void operator delete[](void *ptr) noexcept {
   OPERATOR_DELETE_BODY(_ZdlPvRKSt9nothrow_t);
 }