Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp2a/explicit12.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
rev | line source |
---|---|
145 | 1 // P0892R2 |
2 // { dg-do compile } | |
3 // { dg-options "-std=c++2a" } | |
4 | |
5 template<typename> struct A { | |
6 template<typename T, int N = 0> | |
7 explicit(N) operator T(); | |
8 }; | |
9 | |
10 template<typename> struct B { | |
11 template<typename T, int N = 1> | |
12 explicit(N) operator T(); | |
13 }; | |
14 | |
15 void | |
16 bar () | |
17 { | |
18 A<int> a; | |
19 int i = a; | |
20 | |
21 B<int> b; | |
22 int j = b; // { dg-error "cannot convert" } | |
23 } |