15 #if __cplusplus > 201402L
18 #define THROW_INT throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
36 E1() THROW_INT { throw int(); }
41 F(const F&) throw() { }
46 G(const G&) THROW_INT { throw int(); }
52 { return __has_nothrow_constructor(T); }
60 { return !!__has_nothrow_constructor(T); }
67 static const bool trait = __has_nothrow_constructor(T);
71 const bool My2<T>::trait;
74 template<typename T, bool b = __has_nothrow_constructor(T)>
76 { static const bool trait = b; };
78 template<typename T, bool b>
79 const bool My3_help<T, b>::trait;
87 { return My3_help<T>::trait; }
90 #define PTEST(T) (__has_nothrow_constructor(T) && f<T>() \
91 && My<T>().f() && My2<T>::trait && My3<T>().f())
93 #define NTEST(T) (!__has_nothrow_constructor(T) && !f<T>() \
94 && !My<T>().f() && !My2<T>::trait && !My3<T>().f())
99 assert (NTEST (int (int)));
100 assert (NTEST (void));
104 assert (PTEST (C[]));