diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-20 12:31:44 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-20 12:31:44 +0000 |
commit | f607c97bf2165fb615a98372a707929ca6f39e46 (patch) | |
tree | 4e9b7a1fefd171a2f1b5d078b55d477f30d5c3e2 /gcc/cp/call.c | |
parent | 032987e98aa0513d8978c2725dee4b8dcca968bf (diff) | |
download | ppe42-gcc-f607c97bf2165fb615a98372a707929ca6f39e46.tar.gz ppe42-gcc-f607c97bf2165fb615a98372a707929ca6f39e46.zip |
2007-08-20 Richard Guenther <rguenther@suse.de>
PR c++/22369
PR c++/22451
* call.c (build_new_method_call): Convert initializer to
the basetype.
* init.c (build_aggr_init): Do not fiddle with types.
(build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
* except.c (build_throw): Do not drop qualifiers for the
pointer type.
* typeck.c (get_member_function_from_ptrfunc): Do not
fiddle with types, instead convert.
(build_ptrmemfunc1): Convert to the target type for
initialization.
(gfc_trans_allocate): Convert result to target type.
* cp-objcp-common.c (cxx_get_alias_set): Pointers to
pointer-to-member structures shall have alias set zero as well.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127647 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 79b8cd5bc6f..a504dc84abc 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5514,15 +5514,18 @@ build_new_method_call (tree instance, tree fns, tree args, instance_ptr = build_this (instance); - /* It's OK to call destructors on cv-qualified objects. Therefore, - convert the INSTANCE_PTR to the unqualified type, if necessary. */ - if (DECL_DESTRUCTOR_P (fn)) + /* It's OK to call destructors and constructors on cv-qualified objects. + Therefore, convert the INSTANCE_PTR to the unqualified type, if + necessary. */ + if (DECL_DESTRUCTOR_P (fn) + || DECL_CONSTRUCTOR_P (fn)) { tree type = build_pointer_type (basetype); if (!same_type_p (type, TREE_TYPE (instance_ptr))) instance_ptr = build_nop (type, instance_ptr); - name = complete_dtor_identifier; } + if (DECL_DESTRUCTOR_P (fn)) + name = complete_dtor_identifier; class_type = (conversion_path ? BINFO_TYPE (conversion_path) : NULL_TREE); mem_args = tree_cons (NULL_TREE, instance_ptr, args); |