Commit d881ff25 by Mark Mitchell

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
parent db1a6d86
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> 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. to build1.
2002-10-01 Mark Mitchell <mark@codesourcery.com> 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 * decl.c (cp_finish_decl): Correct check for dynamic
initialization of thread-local storage. initialization of thread-local storage.
......
...@@ -8253,6 +8253,12 @@ cp_finish_decl (decl, init, asmspec_tree, flags) ...@@ -8253,6 +8253,12 @@ cp_finish_decl (decl, init, asmspec_tree, flags)
taken place. */ taken place. */
DECL_INITIALIZED_P (decl) = 1; 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 /* Add this declaration to the statement-tree. This needs to happen
......
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