Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/noexcept24.C

raw
1 // PR c++/53025
2 // { dg-do compile { target c++11 } }
3
4 template<typename T>
5 struct A {
6 A() noexcept {}
7 A(const A&) noexcept(false) {}
8 };
9
10 template<typename T>
11 void a(A<T>) noexcept {}
12
13 template<typename T>
14 void f()
15 {
16 #if __cplusplus <= 201402L
17 const bool val = false;
18 #else
19 const bool val = true;
20 #endif
21 static_assert(val == noexcept(a(A<T>{})), "");
22 }
23
24 void g()
25 {
26 f<int>();
27 }