mirror of git://gcc.gnu.org/git/gcc.git
decl.c (start_preparsed_function): Remove unnecessary bracing.
* decl.c (start_preparsed_function): Remove unnecessary bracing. (finish_destructor_body): Don't emit operator delete here. From-SVN: r234640
This commit is contained in:
parent
865c2770db
commit
8f80cbdb26
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-03-31 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
|
* decl.c (start_preparsed_function): Remove unnecessary bracing.
|
||||||
|
(finish_destructor_body): Don't emit operator delete here.
|
||||||
|
|
||||||
2016-03-31 Nathan Sidwell <nathan@acm.org>
|
2016-03-31 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
PR c++/70393
|
PR c++/70393
|
||||||
|
|
|
||||||
|
|
@ -14170,9 +14170,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
|
||||||
if (DECL_DESTRUCTOR_P (decl1)
|
if (DECL_DESTRUCTOR_P (decl1)
|
||||||
|| (DECL_CONSTRUCTOR_P (decl1)
|
|| (DECL_CONSTRUCTOR_P (decl1)
|
||||||
&& targetm.cxx.cdtor_returns_this ()))
|
&& targetm.cxx.cdtor_returns_this ()))
|
||||||
{
|
cdtor_label = create_artificial_label (input_location);
|
||||||
cdtor_label = create_artificial_label (input_location);
|
|
||||||
}
|
|
||||||
|
|
||||||
start_fname_decls ();
|
start_fname_decls ();
|
||||||
|
|
||||||
|
|
@ -14428,35 +14426,6 @@ finish_destructor_body (void)
|
||||||
and member cleanups will be run when the function returns. */
|
and member cleanups will be run when the function returns. */
|
||||||
add_stmt (build_stmt (input_location, LABEL_EXPR, cdtor_label));
|
add_stmt (build_stmt (input_location, LABEL_EXPR, cdtor_label));
|
||||||
|
|
||||||
/* In a virtual destructor, we must call delete. */
|
|
||||||
if (DECL_VIRTUAL_P (current_function_decl))
|
|
||||||
{
|
|
||||||
tree if_stmt;
|
|
||||||
tree virtual_size = cxx_sizeof (current_class_type);
|
|
||||||
|
|
||||||
/* [class.dtor]
|
|
||||||
|
|
||||||
At the point of definition of a virtual destructor (including
|
|
||||||
an implicit definition), non-placement operator delete shall
|
|
||||||
be looked up in the scope of the destructor's class and if
|
|
||||||
found shall be accessible and unambiguous. */
|
|
||||||
exprstmt = build_op_delete_call (DELETE_EXPR, current_class_ptr,
|
|
||||||
virtual_size,
|
|
||||||
/*global_p=*/false,
|
|
||||||
/*placement=*/NULL_TREE,
|
|
||||||
/*alloc_fn=*/NULL_TREE,
|
|
||||||
tf_warning_or_error);
|
|
||||||
|
|
||||||
if_stmt = begin_if_stmt ();
|
|
||||||
finish_if_stmt_cond (build2 (BIT_AND_EXPR, integer_type_node,
|
|
||||||
current_in_charge_parm,
|
|
||||||
integer_one_node),
|
|
||||||
if_stmt);
|
|
||||||
finish_expr_stmt (exprstmt);
|
|
||||||
finish_then_clause (if_stmt);
|
|
||||||
finish_if_stmt (if_stmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (targetm.cxx.cdtor_returns_this ())
|
if (targetm.cxx.cdtor_returns_this ())
|
||||||
{
|
{
|
||||||
tree val;
|
tree val;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue