1 // RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -DUSE -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
4 // Maybe force the implicit declaration of 'operator delete' and 'operator
5 // delete[]'. This should make no difference to anything!
13 // Deallocation functions are implicitly noexcept.
14 // Thus, explicit specs aren't allowed to conflict.
16 void operator delete(void*); // expected-warning {{function previously declared with an explicit exception specification redeclared with an implicit exception specification}}
17 void operator delete[](void*); // expected-warning {{function previously declared with an explicit exception specification redeclared with an implicit exception specification}}
19 static_assert(noexcept(operator delete(0)), "");
20 static_assert(noexcept(operator delete[](0)), "");
22 // Same goes for explicit declarations.
23 void operator delete(void*, float);
24 void operator delete[](void*, float);
26 static_assert(noexcept(operator delete(0, 0.f
)), "");
27 static_assert(noexcept(operator delete[](0, 0.f
)), "");
29 // But explicit specs stay.
30 void operator delete(void*, double) throw(int); // expected-note {{previous}}
31 static_assert(!noexcept(operator delete(0, 0.)), "");
32 void operator delete(void*, double) noexcept
; // expected-error {{does not match}}