| 1 |
// PR c++/102753 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
// { dg-options "" } |
| 4 |
|
| 5 |
consteval int foo () { return 42; } |
| 6 |
|
| 7 |
consteval int |
| 8 |
bar (int (*fn) ()) |
| 9 |
{ |
| 10 |
return fn (); |
| 11 |
} |
| 12 |
|
| 13 |
void |
| 14 |
baz () |
| 15 |
{ |
| 16 |
static_assert (bar (({ constexpr auto a = 1; foo; })) == 42); |
| 17 |
} |