Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-throw.C
blob9c49fa4e9e85131b0cddfccc53c58e79ee9c495e
1 // { dg-do compile { target c++11 } }
2 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
4 constexpr int may_throw(bool decide) {
5         return decide ? 42 : throw -1; // { dg-error "throw" }
8 constexpr int x = may_throw(false); // { dg-message "may_throw" }
9 constexpr int y = may_throw(true);