Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/lambda-targ22a.C

raw
1 // PR c++/123665
2 // { dg-do compile { target c++20 } }
3 // A more elaborate version of lambda-targ22.C.
4
5 template<class T, class U, class V>
6 struct W { };
7
8 template<class T, class U,
9 class V = decltype([](auto x){ return W<T, U, decltype(x)>{}; })>
10 struct A { using type = V; };
11
12 template<class T>
13 auto f() {
14 return []<typename U>(U) {
15 return typename A<T*, U&>::type{}(true);
16 }(0);
17 }
18
19 using type = decltype(f<void>());
20 using type = W<void*, int&, bool>;