gcc/testsuite/g++.dg/cpp2a/consteval-prop13.C
raw| 1 | // P2564R3 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // Verify we don't recurse endlessly while determining whether a function |
| 4 | // should be propagated to consteval. |
| 5 | |
| 6 | consteval int id (int i) { return i; } |
| 7 | |
| 8 | constexpr int f2 (auto); |
| 9 | |
| 10 | constexpr int |
| 11 | f1 (auto i) |
| 12 | { |
| 13 | return f2 (i); |
| 14 | } |
| 15 | |
| 16 | constexpr int |
| 17 | f2 (auto i) |
| 18 | { |
| 19 | return f1 (i); |
| 20 | } |
| 21 | |
| 22 | auto p = &f1<int>; |
| 23 | auto q = &f2<int>; |