summaryrefslogtreecommitdiff
path: root/clang/test/CXX/except/except.spec/p15.cpp
blob: 110ec3fa0300e1b72854e5b92fa0d6dbad9ac13a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s

// Deallocation functions are implicitly noexcept.
// Thus, explicit specs aren't allowed to conflict.

void f() {
  // Force implicit declaration of delete.
  delete new int;
  delete[] new int[1];
}

void operator delete(void*) noexcept;
void operator delete[](void*) noexcept;

// Same goes for explicit declarations.
void operator delete(void*, float);
void operator delete(void*, float) noexcept;

void operator delete[](void*, float);
void operator delete[](void*, float) noexcept;

// But explicit specs stay.
void operator delete(void*, double) throw(int); // expected-note {{previous}}
void operator delete(void*, double) noexcept; // expected-error {{does not match}}