aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-requires8.C
blob: f10e4bcdb9a7967809be217f33aadc10a264a472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile { target c++2a } }

template <class T, class U>
concept C = requires (T t, U u) { t + u; }; // { dg-message "in requirements" }

template <class T, class U>
  requires C<T,U>
void f(T t, U u) { t + u; }

struct non_addable { };

int main()
{
  // FIXME: This diagnostic is being emitted twice, when it should
  // be emitted just once.
  using U = decltype(f(42, non_addable{})); // { dg-error "cannot call function" }
}