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

template <typename b, typename c> concept d = requires(b e) { e.operator c(); };

template <typename f, typename g> requires(d<f, g>) bool equal(f, g);

template <typename h> struct i {
  i(h);
  operator h();
};

static_assert( d<i<float>, float>);
static_assert(!d<i<float>, int>);

bool fun() {
  i a(2.0f);
  return equal(a, 3.0f);
}