diff options
author | Jason Merrill <jason@redhat.com> | 2013-05-20 13:01:09 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-05-20 13:01:09 -0400 |
commit | 9f0bdc935f2199a2247b9d30858a9262d1a6bfa8 (patch) | |
tree | 29e63f39501d7b153fe603378cbc7d205bbf7167 /gcc/cp/tree.c | |
parent | 14c2ec26e2d1232b88906927355517d34ffdbab6 (diff) | |
download | gcc-9f0bdc935f2199a2247b9d30858a9262d1a6bfa8.zip gcc-9f0bdc935f2199a2247b9d30858a9262d1a6bfa8.tar.gz gcc-9f0bdc935f2199a2247b9d30858a9262d1a6bfa8.tar.bz2 |
re PR c++/57325 (ICE in strip_typedefs, at cp/tree.c:1306)
PR c++/57325
* tree.c (build_cplus_array_type): Copy layout info if element
type is complete.
From-SVN: r199113
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 2df2087..9c324e3 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -829,10 +829,12 @@ build_cplus_array_type (tree elt_type, tree index_type) if (TYPE_MAIN_VARIANT (t) != m) { - if (COMPLETE_TYPE_P (t) && !COMPLETE_TYPE_P (m)) + if (COMPLETE_TYPE_P (TREE_TYPE (t)) && !COMPLETE_TYPE_P (m)) { /* m was built before the element type was complete, so we - also need to copy the layout info from t. */ + also need to copy the layout info from t. We might + end up doing this multiple times if t is an array of + unknown bound. */ tree size = TYPE_SIZE (t); tree size_unit = TYPE_SIZE_UNIT (t); unsigned int align = TYPE_ALIGN (t); |