re PR c++/57610 (Reference initialized with temporary instead of sub-object of conver...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 30 Apr 2015 09:43:39 +0000 (09:43 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 30 Apr 2015 09:43:39 +0000 (09:43 +0000)
2015-04-30  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/57610
* g++.dg/init/ref22.C: New.

From-SVN: r222615

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/ref22.C [new file with mode: 0644]

index 29e177ee35295438345a234b6331c799b3a07ce3..e0df670404ca7f694f79f4bb4435631b39f8c1e0 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-30  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/57610
+       * g++.dg/init/ref22.C: New.
+
 2015-04-30  Marek Polacek  <polacek@redhat.com>
 
        * gcc.dg/init-bad-8.c: New test.
diff --git a/gcc/testsuite/g++.dg/init/ref22.C b/gcc/testsuite/g++.dg/init/ref22.C
new file mode 100644 (file)
index 0000000..93210ef
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/57610
+// { dg-do run }
+
+extern "C" void abort();
+
+struct A
+{
+  A() { }
+  A(const A&) { abort(); }
+};
+
+struct B : A { };
+
+struct X
+{
+  operator B() { return B(); }
+};
+
+int main()
+{
+  X x;
+  const A& r = x;
+}