2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wno-terminate" }
6 struct True2 { ~True2(); };
7 struct True3 { ~True3(){ throw 0; } };
8 struct False { ~False() noexcept(false); };
10 template <typename Base>
15 template <typename Member>
21 template <typename Base, typename Member>
27 #define SA(X) static_assert(X, #X)
29 SA( noexcept(True1()));
30 SA( noexcept(True2()));
31 SA( noexcept(True3()));
32 SA(!noexcept(False()));
34 SA( noexcept(A<True1>()));
35 SA( noexcept(A<True2>()));
36 SA( noexcept(A<True3>()));
37 SA(!noexcept(A<False>()));
39 SA( noexcept(B<True1>()));
40 SA( noexcept(B<True2>()));
41 SA( noexcept(B<True3>()));
42 SA(!noexcept(B<False>()));
44 SA( noexcept(C<True1, True2>()));
45 SA( noexcept(C<True1, True3>()));
46 SA( noexcept(C<True2, True3>()));
47 SA( noexcept(C<True2, True1>()));
48 SA( noexcept(C<True3, True1>()));
49 SA( noexcept(C<True3, True2>()));
50 SA(!noexcept(C<False, True1>()));
51 SA(!noexcept(C<False, True2>()));
52 SA(!noexcept(C<False, True3>()));
53 SA(!noexcept(C<True1, False>()));
54 SA(!noexcept(C<True2, False>()));
55 SA(!noexcept(C<True3, False>()));