aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAdam Nemet <anemet@lnxw.com>2004-05-27 19:08:57 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2004-05-27 19:08:57 +0000
commit81b4398d1e7f594c956213db39cf1b021561ef29 (patch)
tree2fd6f5b0ff53e9eef59f5bab9d2fc106c512bc17 /gcc
parent30f1bddcb7217576c4b746ca0e84e50e3684cf78 (diff)
downloadgcc-81b4398d1e7f594c956213db39cf1b021561ef29.zip
gcc-81b4398d1e7f594c956213db39cf1b021561ef29.tar.gz
gcc-81b4398d1e7f594c956213db39cf1b021561ef29.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b279280..92b10d0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b666dd7..8a464be 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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. */