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

template<class T, class U> concept C = __is_same(U, int);

template<class T> void f() {
  []() -> C<T> auto {
    C<T> auto x = T(); // { dg-error "constraints" }
    return T(); // { dg-error "constraints" }
  }();
}

template void f<int>(); // { dg-bogus "" }
template void f<char>(); // { dg-message "required from here" }