p15.cpp revision 8999fe1bc367b3ecc878d135c7b31e3479da56f4
1// RUN: %clang_cc1 -std=c++0x -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
2
3// Deallocation functions are implicitly noexcept.
4// Thus, explicit specs aren't allowed to conflict.
5
6void f() {
7  // Force implicit declaration of delete.
8  delete new int;
9  delete[] new int[1];
10}
11
12void operator delete(void*) noexcept;
13void operator delete[](void*) noexcept;
14
15// Same goes for explicit declarations.
16void operator delete(void*, float);
17void operator delete(void*, float) noexcept;
18
19void operator delete[](void*, float);
20void operator delete[](void*, float) noexcept;
21
22// But explicit specs stay.
23void operator delete(void*, double) throw(int); // expected-note {{previous}}
24void operator delete(void*, double) noexcept; // expected-error {{does not match}}
25