OSDN Git Service

PR c++/8748
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jan 2003 09:16:21 +0000 (09:16 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jan 2003 09:16:21 +0000 (09:16 +0000)
        * class.c (build_base_path): Take the address before calling save_expr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61250 138bc75d-0d04-0410-961f-82ee72b054a4

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

diff --git a/gcc/testsuite/g++.dg/init/save1.C b/gcc/testsuite/g++.dg/init/save1.C
new file mode 100644 (file)
index 0000000..2358eb5
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/8748
+// We were wrapping the ARRAY_REF in a SAVE_EXPR, causing us to try to make a bitwise
+// copy of b[0].
+
+struct A
+{
+    int i;
+};
+
+struct B : A
+{
+    virtual ~B();
+};
+
+struct C
+{
+    B b[1];
+};
+
+void foo() { C().b[0].i; }