YouCompleteMe/cpp/llvm/tools/clang/test/CXX/except/except.spec/p15.cpp
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

25 lines
764 B
C++

// 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}}