gcc/testsuite/g++.dg/cpp2a/concepts-lambda13.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | |
| 3 | template<typename T> |
| 4 | struct S { |
| 5 | using type = T::type; // { dg-bogus "" } |
| 6 | }; |
| 7 | |
| 8 | template<typename T> |
| 9 | auto f() { |
| 10 | return [] <typename U> (U) { |
| 11 | // Verify that partial instantiation of this generic lambda doesn't cause |
| 12 | // these requirements to get checked out of order. |
| 13 | static_assert(!requires { typename U::type; typename S<T>::type; }); |
| 14 | return 0; |
| 15 | }; |
| 16 | } |
| 17 | |
| 18 | int a = f<int>()(0); |