summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-29 06:23:49 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-29 06:23:49 +0000
commitf2fffff3b77359770f197d29ccbeb5bce04e1cb2 (patch)
treefd24483a463c1c2221cb897dae5a9621363fa39f
parent93b4f514639d51295df376f9a0b54562b365e952 (diff)
downloadgcc-f2fffff3b77359770f197d29ccbeb5bce04e1cb2.tar.gz
PR middle-end/17525
* class.c (build_base_field): Set TYPE_MODE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88270 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c1
-rw-r--r--gcc/testsuite/g++.dg/init/synth1.C17
3 files changed, 23 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9eed9186f84..5444a09ba63 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-28 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/17525
+ * class.c (build_base_field): Set TYPE_MODE.
+
2004-09-28 Roger Sayle <roger@eyesopen.com>
PR driver/17537
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index deff5731167..b3d5d969f33 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3563,6 +3563,7 @@ build_base_field (record_layout_info rli, tree binfo,
DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype);
DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype);
DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
+ DECL_MODE (decl) = TYPE_MODE (basetype);
DECL_IGNORED_P (decl) = 1;
DECL_FIELD_IS_BASE (decl) = 1;
diff --git a/gcc/testsuite/g++.dg/init/synth1.C b/gcc/testsuite/g++.dg/init/synth1.C
new file mode 100644
index 00000000000..6c00bc0228e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/synth1.C
@@ -0,0 +1,17 @@
+// PR middle-end/17525
+
+struct A
+{
+ ~A();
+ int a;
+};
+
+struct B : public A
+{
+ virtual ~B();
+};
+
+void run (B& b, B& b1)
+{
+ b1 = b;
+}