summaryrefslogtreecommitdiffstats
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-16 17:48:05 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-16 17:48:05 +0000
commit3cb031499618fd74eb12c50e420b5a1acd33d3e9 (patch)
treee804560654f45478defb7ef6556ef0b17b4593c9 /gcc/cp/method.c
parent28ed8201a2780ce904f2e498168f08f3518b5f94 (diff)
downloadppe42-gcc-3cb031499618fd74eb12c50e420b5a1acd33d3e9.tar.gz
ppe42-gcc-3cb031499618fd74eb12c50e420b5a1acd33d3e9.zip
* decl2.c (import_export_decl): Use same_type_p, rather than
relying on pointer-equality for types. * method.c (do_build_copy_constructor): Simplify. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27555 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index cf030137056..caa3eb597a2 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -2231,42 +2231,21 @@ do_build_copy_constructor (fndecl)
tree binfos = TYPE_BINFO_BASETYPES (current_class_type);
int i;
+ /* Initialize all the base-classes. */
for (t = CLASSTYPE_VBASECLASSES (current_class_type); t;
t = TREE_CHAIN (t))
- {
- tree basetype = BINFO_TYPE (t);
- tree p = convert_to_reference
- (build_reference_type (basetype), parm,
- CONV_IMPLICIT|CONV_CONST, LOOKUP_COMPLAIN, NULL_TREE);
- p = convert_from_reference (p);
-
- if (p == error_mark_node)
- cp_error ("in default copy constructor");
- else
- current_base_init_list = tree_cons (basetype,
- p, current_base_init_list);
- }
-
+ current_base_init_list
+ = tree_cons (BINFO_TYPE (t), parm, current_base_init_list);
for (i = 0; i < n_bases; ++i)
{
- tree p, basetype = TREE_VEC_ELT (binfos, i);
- if (TREE_VIA_VIRTUAL (basetype))
+ t = TREE_VEC_ELT (binfos, i);
+ if (TREE_VIA_VIRTUAL (t))
continue;
- basetype = BINFO_TYPE (basetype);
- p = convert_to_reference
- (build_reference_type (basetype), parm,
- CONV_IMPLICIT|CONV_CONST, LOOKUP_COMPLAIN, NULL_TREE);
-
- if (p == error_mark_node)
- cp_error ("in default copy constructor");
- else
- {
- p = convert_from_reference (p);
- current_base_init_list = tree_cons (basetype,
- p, current_base_init_list);
- }
+ current_base_init_list
+ = tree_cons (BINFO_TYPE (t), parm, current_base_init_list);
}
+
for (; fields; fields = TREE_CHAIN (fields))
{
tree init, t;
OpenPOWER on IntegriCloud