Commit 81b4398d by Adam Nemet Committed by Adam Nemet

re PR c++/12883 (destructor of array object not called if no prior instantiation…

re PR c++/12883 (destructor of array object not called if no prior instantiation of the template has happened)

	PR c++/12883
	* decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
	TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.

From-SVN: r82333
parent 30f1bddc
2004-05-27 Adam Nemet <anemet@lnxw.com>
PR c++/12883
* decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
2004-05-24 Geoffrey Keating <geoffk@apple.com>
* method.c (implicitly_declare_fn): Don't call defer_fn; abort
......
......@@ -5337,6 +5337,7 @@ complete_array_type (tree type, tree initial_value, int do_default)
{
tree itype;
tree domain;
tree elt_type;
domain = build_index_type (maxindex);
TYPE_DOMAIN (type) = domain;
......@@ -5354,6 +5355,12 @@ complete_array_type (tree type, tree initial_value, int do_default)
size of the array. */
if (! TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)))
TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = domain;
elt_type = TREE_TYPE (type);
TYPE_NEEDS_CONSTRUCTING (type)
= TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type));
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type));
}
/* Lay out the type now that we can get the real answer. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment