diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2005-12-06 19:45:00 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2005-12-06 19:45:00 +0000 |
commit | d7d938374664ca711b5bb894486394425d8c9227 (patch) | |
tree | 9a4d882c3bd13e5816af7f4580ea174e21a1509f /gcc/cp/decl.c | |
parent | 3af22b23b32d69bd7cc0d444429f33e4edae008d (diff) | |
download | gcc-d7d938374664ca711b5bb894486394425d8c9227.zip gcc-d7d938374664ca711b5bb894486394425d8c9227.tar.gz gcc-d7d938374664ca711b5bb894486394425d8c9227.tar.bz2 |
re PR c++/24138 (ICE with the code in PR 20407)
PR C++/24138
* tree.c (integer_all_onesp): Always return true if all bits on.
* cp/decl.c (reshape_init_array_1): Handle max_index of -1.
* testsuite/g++.dg/init/array0.C: New.
From-SVN: r108126
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b5f89fc..ffa5e33 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4209,6 +4209,10 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d) if (sized_array_p) { + /* Minus 1 is used for zero sized arrays. */ + if (integer_all_onesp (max_index)) + return new_init; + if (host_integerp (max_index, 1)) max_index_cst = tree_low_cst (max_index, 1); /* sizetype is sign extended, not zero extended. */ |