aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/consteval-if13.C
blob: b10ec18b3c6e9a5ac80cafe97113d378a172c613 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/115583
// { dg-do compile { target c++23 } }
// { dg-additional-options -O }

consteval int f(int i) {
  return i;
}
const bool b = 0;
constexpr int g(int i) {
  if consteval {
    return f(i);
  } else {
    return i;
  }
}
int main() {
  return g(1);
}