c++: P0847R7 (deducing this) - xobj lambdas. [PR102609]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / consteval13.C
blob09ea6b70b6b1bff5fef797ad4147b2eff7d99fd6
1 // { dg-do compile }
2 // { dg-options "-std=c++2a" }
4 consteval int bar () { return 42; }
5 consteval int baz () { return 1; }
6 typedef int (*fnptr) ();
7 consteval fnptr quux () { return bar; }
9 void
10 foo ()
12    auto qux = [] (fnptr a = quux ()) consteval { return a (); };
13    constexpr auto c = qux (baz);
14    constexpr auto d = qux (bar);
15    static_assert (c == 1);
16    static_assert (d == 42);