1 // Test for noexcept-expression
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-O2" }
7 #define SA(X) static_assert(X, #X)
13 SA(!noexcept(throw 1));
31 SA (noexcept (dynamic_cast<B*>(ap)));
32 SA (!noexcept (dynamic_cast<B&>(*ap)));
33 SA (!noexcept (typeid (*ap)));
34 SA (noexcept (typeid (*cp)));
36 SA (!noexcept (true ? 1 : throw 1));
37 SA (!noexcept (true || true ? 1 : throw 1));
71 template <class T, bool b>
74 SA (noexcept (T()) == b);
77 template void tf<int,true>();
78 template void tf<E, true>();
80 // Make sure that noexcept uses the declared exception-specification, not
81 // any knowledge we might have about whether or not the function really