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

// But make sure we do consider template conversions that could produce the
// right type.

template <class T>
struct Error { static constexpr auto value = T::value; }; // { dg-error "not a member" }

struct A { A(const A&); };

template <class T>
struct B { template <class U> operator U() requires Error<T>::value; };

template <class T>
concept C = requires (B<T> b) { A(b); }; // { dg-message "required from here" }

static_assert(!C<int>);