gcc/testsuite/g++.dg/cpp2a/concepts-lambda17.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | |
| 3 | template<class T> |
| 4 | struct A { static const bool value = T::value; }; |
| 5 | |
| 6 | template<class T> |
| 7 | void f() { |
| 8 | // Verify we don't substitute into a lambda's constraints when |
| 9 | // regenerating it, which would lead to a hard error here. |
| 10 | [] () requires (T::value && A<T>::value) || true { }(); |
| 11 | [] <class U> (U) requires (U::value && A<T>::value) || true { }(0); |
| 12 | } |
| 13 | |
| 14 | template void f<int>(); |