aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-lambda17.C
blob: 32ae1e121748bb3073cf804be8fc1018ef549cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// { dg-do compile { target c++20 } }

template<class T>
struct A { static const bool value = T::value; };

template<class T>
void f() {
  // Verify we don't substitute into a lambda's constraints when
  // regenerating it, which would lead to a hard error here.
  [] () requires (T::value && A<T>::value) || true { }();
  [] <class U> (U) requires (U::value && A<T>::value) || true { }(0);
}

template void f<int>();