aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval-prop13.C
blob: 6c20b98a87c29e9e151d3f11b9ef674eaed715f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// P2564R3
// { dg-do compile { target c++20 } }
// Verify we don't recurse endlessly while determining whether a function
// should be propagated to consteval.

consteval int id (int i) { return i; }

constexpr int f2 (auto);

constexpr int
f1 (auto i)
{
  return f2 (i);
}

constexpr int
f2 (auto i)
{
  return f1 (i);
}

auto p = &f1<int>;
auto q = &f2<int>;