Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/explicit5.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // test for extension of DR 899 to handle template ctors |
2 // { dg-do run { target c++11 } } | |
3 | |
4 int r = 1; | |
5 | |
6 struct C { | |
7 C() { } | |
8 template <class T = int> C(C&, T = 0) { r = 0; } | |
9 }; | |
10 | |
11 C c; | |
12 | |
13 struct A | |
14 { | |
15 explicit operator C&() const { return c; } | |
16 }; | |
17 | |
18 int main() | |
19 { | |
20 A a; | |
21 C c2 (a); | |
22 | |
23 return r; | |
24 } |