aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2002-10-02 01:16:22 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-10-02 01:16:22 +0000
commitd881ff25796f4a9073be87a0542d28779959bf46 (patch)
treeedecb4ba020525d3b1598619510caa5322fb60c8 /gcc
parentdb1a6d8676cad798f8473444e82f4461569b68fd (diff)
downloadgcc-d881ff25796f4a9073be87a0542d28779959bf46.zip
gcc-d881ff25796f4a9073be87a0542d28779959bf46.tar.gz
gcc-d881ff25796f4a9073be87a0542d28779959bf46.tar.bz2
decl.c (cp_finish_decl): Make sure array types are laid out, even if the array bounds are unknown.
* decl.c (cp_finish_decl): Make sure array types are laid out, even if the array bounds are unknown. From-SVN: r57717
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/decl.c6
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1c9e5a6..e78f0c2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,10 +1,18 @@
+2002-10-01 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (cp_finish_decl): Make sure array types are laid out,
+ even if the array bounds are unknown.
+
2002-10-01 Steve Ellcey <sje@cup.hp.com>
- * cp/class.c (build_vtbl_initializer): Change build_c_cast
+ * class.c (build_vtbl_initializer): Change build_c_cast
to build1.
2002-10-01 Mark Mitchell <mark@codesourcery.com>
+ * decl.c (cp_finish_decl): Make sure array types are laid out,
+ even if the array bounds are unknown.
+
* decl.c (cp_finish_decl): Correct check for dynamic
initialization of thread-local storage.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index eec8bbb..7375fde 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8253,6 +8253,12 @@ cp_finish_decl (decl, init, asmspec_tree, flags)
taken place. */
DECL_INITIALIZED_P (decl) = 1;
}
+ /* If the variable has an array type, lay out the type, even if
+ there is no initializer. It is valid to index through the
+ array, and we must get TYPE_ALIGN set correctly on the array
+ type. */
+ else if (TREE_CODE (type) == ARRAY_TYPE)
+ layout_type (type);
}
/* Add this declaration to the statement-tree. This needs to happen