diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-05-22 12:20:41 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-05-22 12:20:41 +0000 |
commit | 4271a6f36886a604cf9f39d85408b0a2dbe45ecd (patch) | |
tree | 1abc7d64dcc628ccee0d39cc55fbbd8277065f80 /gcc | |
parent | 055c00f145f9613dd27c8a1e17fb0794f53fc9de (diff) | |
download | gcc-4271a6f36886a604cf9f39d85408b0a2dbe45ecd.zip gcc-4271a6f36886a604cf9f39d85408b0a2dbe45ecd.tar.gz gcc-4271a6f36886a604cf9f39d85408b0a2dbe45ecd.tar.bz2 |
re PR c/26818 (tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in finish_struct, at c-decl.c:5350 (time.c))
PR c/26818
* c-decl.c (finish_struct): Skip erroneous fields.
* gcc.dg/struct-incompl-1.c: New test.
From-SVN: r113975
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/struct-incompl-1.c | 7 |
4 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 281fdc3..5fb269e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c/26818 + * c-decl.c (finish_struct): Skip erroneous fields. + 2006-05-22 Nick Clifton <nickc@redhat.com> * config/cris/cris.opt (march): Remove VarExists attribute. 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8477131..a1c6703 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c/26818 + * gcc.dg/struct-incompl-1.c: New test. + 2006-05-22 Richard Guenther <rguenther@suse.de> PR testsuite/27708 diff --git a/gcc/testsuite/gcc.dg/struct-incompl-1.c b/gcc/testsuite/gcc.dg/struct-incompl-1.c new file mode 100644 index 0000000..c32b2d5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/struct-incompl-1.c @@ -0,0 +1,7 @@ +/* PR c/26818 */ +/* { dg-do compile } */ + +struct __attribute__ ((packed)) A +{ + struct B b; /* { dg-error "incomplete" } */ +}; |