blob: 51728a040e2523cee097a58dfaf3deed1d9c9a33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// PR c++/88313
// { dg-do compile { target c++20 } }
template<int N = [](auto x) { return x; }(42)>
constexpr int f() { return N; }
template<auto F = [](auto x) { return x; }>
constexpr auto g() { return F; }
template<class T = decltype([](auto x) { return x; })>
constexpr int h(T t = {}) { return t(42); }
static_assert(f() == 42);
static_assert(g()(42) == 42);
static_assert(h() == 42);
|