init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.

* init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
	* decl.c (finish_function): Not here.
	(start_function): Do set DECL_INITIAL.

From-SVN: r23392
This commit is contained in:
Jason Merrill 1998-10-28 03:36:56 +00:00 committed by Jason Merrill
parent a554186cb8
commit 2a2480e163
3 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,9 @@
1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
* init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
* decl.c (finish_function): Not here.
(start_function): Do set DECL_INITIAL.
* pt.c (push_template_decl_real): Complain about default template
args for enclosing classes.

View File

@ -12516,6 +12516,10 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
&& TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE)
cp_warning ("`operator=' should return a reference to `*this'");
/* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in poplevel) with the BLOCK. */
DECL_INITIAL (decl1) = error_mark_node;
#ifdef SET_DEFAULT_DECL_ATTRIBUTES
SET_DEFAULT_DECL_ATTRIBUTES (decl1, attrs);
#endif
@ -13074,7 +13078,8 @@ finish_function (lineno, call_poplevel, nested)
pointer to represent the type of our base class. */
/* This side-effect makes call to `build_delete' generate the
code we have to have at the end of this destructor. */
code we have to have at the end of this destructor.
`build_delete' will set the flag again. */
TYPE_HAS_DESTRUCTOR (current_class_type) = 0;
/* These are two cases where we cannot delegate deletion. */
@ -13133,8 +13138,6 @@ finish_function (lineno, call_poplevel, nested)
expand_end_cond ();
}
TYPE_HAS_DESTRUCTOR (current_class_type) = 1;
virtual_size = c_sizeof (current_class_type);
/* At the end, call delete if that's what's requested. */

View File

@ -3079,6 +3079,10 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
tree parent_auto_delete = auto_delete;
tree cond;
/* Set this again before we call anything, as we might get called
recursively. */
TYPE_HAS_DESTRUCTOR (type) = 1;
/* If we have member delete or vbases, we call delete in
finish_function. */
if (auto_delete == integer_zero_node)