18 #if __cplusplus > 201402L
21 #define THROW_INT throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
26 D(const D&) throw() { }
31 E(const E&) THROW_INT { }
36 E1(const E1&) THROW_INT { throw int(); }
46 G() THROW_INT { throw int(); }
56 H1(H1&) THROW_INT { throw int(); }
62 I(const I&) throw() { }
67 I1(I1&) THROW_INT { throw int(); }
68 I1(const I1&) throw() { }
74 J(const J&) throw() { }
75 J(volatile J&) throw() { }
76 J(const volatile J&) throw() { }
82 { return __has_nothrow_copy(T); }
90 { return !!__has_nothrow_copy(T); }
97 static const bool trait = __has_nothrow_copy(T);
101 const bool My2<T>::trait;
103 template<typename T, bool b = __has_nothrow_copy(T)>
105 { static const bool trait = b; };
107 template<typename T, bool b>
108 const bool My3_help<T, b>::trait;
116 { return My3_help<T>::trait; }
119 #define PTEST(T) (__has_nothrow_copy(T) && f<T>() \
120 && My<T>().f() && My2<T>::trait && My3<T>().f())
122 #define NTEST(T) (!__has_nothrow_copy(T) && !f<T>() \
123 && !My<T>().f() && !My2<T>::trait && !My3<T>().f())
127 assert (PTEST (int));
128 assert (NTEST (int (int)));
129 assert (NTEST (void));
133 assert (PTEST (C[]));