2018-04-30 Jason Merrill <jason@redhat.com>
+ * init.c (build_dtor_call): Use build_special_member_call.
+ (build_delete): Remove redundant uses of save_addr.
+
* decl.c (build_clobber_this): Use build_clobber.
2018-04-27 Jakub Jelinek <jakub@redhat.com>
tsubst_flags_t complain)
{
tree name;
- tree fn;
switch (dtor_kind)
{
case sfk_complete_destructor:
default:
gcc_unreachable ();
}
- fn = lookup_fnfields (TREE_TYPE (exp), name, /*protect=*/2);
- return build_new_method_call (exp, fn,
- /*args=*/NULL,
- /*conversion_path=*/NULL_TREE,
- flags,
- /*fn_p=*/NULL,
- complain);
+
+ return build_special_member_call (exp, name,
+ /*args=*/NULL,
+ /*binfo=*/TREE_TYPE (exp),
+ flags,
+ complain);
}
/* Generate a call to a destructor. TYPE is the type to cast ADDR to.
}
}
}
- if (TREE_SIDE_EFFECTS (addr))
- addr = save_expr (addr);
/* Throw away const and volatile on target type of addr. */
addr = convert_force (build_pointer_type (type), addr, 0, complain);
addr = cp_build_addr_expr (addr, complain);
if (addr == error_mark_node)
return error_mark_node;
- if (TREE_SIDE_EFFECTS (addr))
- addr = save_expr (addr);
addr = convert_force (build_pointer_type (type), addr, 0, complain);
}