Sign in
gnu
/
gcc
/
cd2fd5facb5e1882d3f338ed456ae9536f7c0593
/
.
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
constexpr-throw.C
blob: 5666629acae9fba6dca8c902fa823449075d3636 [
file
] [
log
] [
blame
]
// { dg-do compile { target c++11 } }
constexpr
int
may_throw
(
bool
decide
)
{
return
decide
?
42
:
throw
-
1
;
// { dg-error "throw" }
}
constexpr
int
x
=
may_throw
(
false
);
// { dg-message "may_throw" }
constexpr
int
y
=
may_throw
(
true
);