diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit7.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit7.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit7.C new file mode 100644 index 0000000..574796d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit7.C @@ -0,0 +1,18 @@ +// [over.match.conv]: For direct-initialization, those explicit conversion +// functions that are not hidden within S and yield type T or a type that +// can be converted to type T with a qualification conversion (4.4) are +// also candidate functions. + +// { dg-do compile { target c++11 } } +// { dg-options "" } + +struct A { }; +struct B: A { }; +struct C { + explicit operator B*(); // { dg-message "explicit" } + explicit operator B&(); // { dg-message "explicit" } +}; + +C c; +A* ap (c); // { dg-error "" } +A& ar (c); // { dg-error "" } |