blob: 5be9d5974b51ad6fcbc5816a556d3df4096179ee (
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
25
26
27
|
#if defined(__GNUC_MAJOR__)
# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10)
#endif
#if defined(__clang_major__) && defined(__apple_build_version__)
# define APPLE_VERSION (__clang_major__*1000 + __clang_minor__*10)
#elif defined(__clang_major__)
# define LLVM_VERSION (__clang_major__*1000 + __clang_minor__*10)
#endif
#if (GNUC_VERSION >= 4060) || (LLVM_VERSION >= 1070) || (APPLE_VERSION >= 10000)
# pragma GCC diagnostic ignored "-Wterminate"
#endif
#include <stdexcept>
void f(int n) noexcept(false)
{
if (n > 2)
throw std::runtime_error("Oops");
}
int main(int argc, char* argv[])
{
f(argc);
return 0;
}
|