gcc/testsuite/g++.dg/cpp2a/lambda-targ2.C
raw| 1 | // PR c++/114393 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template <auto _DescriptorFn> struct c1 {}; |
| 5 | |
| 6 | template <class _Descriptor, auto t = [] { return _Descriptor(); }> |
| 7 | inline constexpr auto b_v = t; |
| 8 | |
| 9 | template <class _Tag> |
| 10 | using c1_t = c1<b_v<int>>; |
| 11 | |
| 12 | template <class _Data> |
| 13 | constexpr auto g(_Data __data) { |
| 14 | return c1_t<_Data>{}; |
| 15 | } |
| 16 | |
| 17 | void f() { |
| 18 | auto &&b = g(0); |
| 19 | } |