aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/req10.C
blob: 8cbd89f294b7eec45a2afac78a19a0a0e633eadf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-options "-std=c++17 -fconcepts" }

// Test that standard conversions are checked with
// implicit conversion constraints.

template<typename T, typename U>
concept bool C()
{
  return requires(T& t) { {t} -> U&; };
}

struct B { };
class D : B { };

int main()
{
  static_assert(C<D, B>(), ""); // { dg-error "failed" }
}