repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
ipa-cp: Perform operations in the appropriate types (PR 118097)
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
contracts
/
contracts-constexpr3.C
blob
8826220ef913b0bc06e8fc7a19875d8cce7aab38
1
// An assumed contract shouldn't break constant evaluation.
2
3
// { dg-do compile { target c++20 } }
4
// { dg-additional-options -fcontracts }
5
6
bool b;
7
8
constexpr int f() [[ pre assume: b ]] { return 42; }
9
10
static_assert (f() > 0);