xref: /llvm-project/clang/test/CXX/except/except.spec/p11.cpp (revision 7538b35cef29c835879c0a4e8cb333ac886c9be9)
1 // RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
2 
3 // This is the "let the user shoot themselves in the foot" clause.
f()4 void f() noexcept { // expected-note {{function declared non-throwing here}}
5   throw 0; // expected-warning {{has a non-throwing exception specification but}}
6 }
g()7 void g() throw() { // expected-note {{function declared non-throwing here}}
8   throw 0; // expected-warning {{has a non-throwing exception specification but}}
9 }
h()10 void h() throw(int) {
11   throw 0.0; // no-error
12 }
13