From 4271a6f36886a604cf9f39d85408b0a2dbe45ecd Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Mon, 22 May 2006 12:20:41 +0000 Subject: =?UTF-8?q?re=20PR=20c/26818=20(tree=20check:=20expected=20class?= =?UTF-8?q?=20=E2=80=98type=E2=80=99,=20have=20=E2=80=98exceptional?= =?UTF-8?q?=E2=80=99=20(error=5Fmark)=20in=20finish=5Fstruct,=20at=20c-dec?= =?UTF-8?q?l.c:5350=20(time.c))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR c/26818 * c-decl.c (finish_struct): Skip erroneous fields. * gcc.dg/struct-incompl-1.c: New test. From-SVN: r113975 --- gcc/c-decl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 9ece1ce..d7362c1 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5396,6 +5396,9 @@ finish_struct (tree t, tree fieldlist, tree attributes) saw_named_field = 0; for (x = fieldlist; x; x = TREE_CHAIN (x)) { + if (TREE_TYPE (x) == error_mark_node) + continue; + DECL_CONTEXT (x) = t; if (TYPE_PACKED (t) && TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT) -- cgit v1.1