aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/explicit7.C
blob: dfa4e138d4cb0364152bd514b5b3c517b6a57828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// P0892R2
// { dg-do compile }
// { dg-options "-std=c++2a" }

template<typename T>
struct B {
  static const T value = true;
};

struct X {
  template<typename T>
  explicit(B<T>::value) operator T();
};

int
main ()
{
  X x;
  int i = x.operator int();
  int i3 = x; // { dg-error "cannot convert" }
  int i2{x};
}