diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35a872893bb..790bc10edb2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-02-10 Richard Henderson + + PR c/5623 + * c-typeck.c (incomplete_type_error): Handle flexible array members. + 2002-02-10 Richard Henderson PR c++/5624 diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index dc844bfb7a3..5d5b5f97870 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -149,6 +149,11 @@ incomplete_type_error (value, type) case ARRAY_TYPE: if (TYPE_DOMAIN (type)) { + if (TYPE_MAX_VALUE (TYPE_DOMAIN (type)) == NULL) + { + error ("invalid use of flexible array member"); + return; + } type = TREE_TYPE (type); goto retry; }