re PR c++/29002 (ICE on array of ptr-to-member or struct containing ptr-to-member of unknown size)

2006-09-14  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/29002
        * init.c (build_zero_init): If we have an error mark node for
        the array size, return.

2006-09-14  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/29002
        * g++.dg/init/array22.C: New test.
        * g++.dg/init/array23.C: New test.

From-SVN: r116962
This commit is contained in:
Andrew Pinski 2006-09-15 04:50:04 +00:00 committed by Andrew Pinski
parent 0b35aac25d
commit 9bdb04a2f5
5 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-09-14 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/29002
* init.c (build_zero_init): If we have an error mark node for
the array size, return.
2006-09-10 Mark Mitchell <mark@codesourcery.com>
PR c++/28991

View File

@ -223,6 +223,11 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
nelts, integer_one_node);
else
max_index = array_type_nelts (type);
/* If we have an error_mark here, we should just return error mark
as we don't know the size of the array yet. */
if (max_index == error_mark_node)
return error_mark_node;
gcc_assert (TREE_CODE (max_index) == INTEGER_CST);
/* A zero-sized array, which is accepted as an extension, will

View File

@ -1,3 +1,9 @@
2006-09-14 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/29002
* g++.dg/init/array22.C: New test.
* g++.dg/init/array23.C: New test.
2006-09-14 Arnaud Charlet <charlet@adacore.com>
* stackcheck.lst: Update list of tests requiring stack checking.

View File

@ -0,0 +1,6 @@
// PR C++/29002
// We ICE trying to set the "zero" initializer on the incomplete
// array
struct A {};
int A::* x[]; // { dg-error "size" }

View File

@ -0,0 +1,6 @@
// PR C++/29002
// We ICE trying to set the "zero" initializer on the incomplete
// array
struct A {A();int A::* t;};
A x[]; // { dg-error "size" }