Sign in
gnu
/
gcc
/
refs/heads/devel/c++-contracts
/
.
/
gcc
/
testsuite
/
g++.dg
/
contracts
/
contracts-constexpr3.C
blob: 8826220ef913b0bc06e8fc7a19875d8cce7aab38 [
file
] [
log
] [
blame
]
// An assumed contract shouldn't break constant evaluation.
// { dg-do compile { target c++20 } }
// { dg-additional-options -fcontracts }
bool
b
;
constexpr
int
f
()
[[
pre assume
:
b
]]
{
return
42
;
}
static_assert
(
f
()
>
0
);