aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C
new file mode 100644
index 0000000..1adb8d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C
@@ -0,0 +1,24 @@
+// test for extension of DR 899 to handle template ctors
+// { dg-do run { target c++11 } }
+
+int r = 1;
+
+struct C {
+ C() { }
+ template <class T = int> C(C&, T = 0) { r = 0; }
+};
+
+C c;
+
+struct A
+{
+ explicit operator C&() const { return c; }
+};
+
+int main()
+{
+ A a;
+ C c2 (a);
+
+ return r;
+}