re PR c++/11878 (ICE in cp_expr_size)
authorJason Merrill <jason@gcc.gnu.org>
Tue, 14 Oct 2003 20:47:07 +0000 (16:47 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 14 Oct 2003 20:47:07 +0000 (16:47 -0400)
        PR c++/11878
        * tree.c (build_target_expr_with_type): Call force_rvalue for
        classes with non-trivial copy ctors.

From-SVN: r72496

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

diff --git a/gcc/testsuite/g++.dg/init/copy6.C b/gcc/testsuite/g++.dg/init/copy6.C
new file mode 100644 (file)
index 0000000..136dc78
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/11878
+
+struct A
+{
+    virtual ~A();
+};
+
+template<typename T> struct B
+{
+    T t;
+};
+
+void foo() { throw B<A>().t; }