aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2006-05-22 12:20:41 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2006-05-22 12:20:41 +0000
commit4271a6f36886a604cf9f39d85408b0a2dbe45ecd (patch)
tree1abc7d64dcc628ccee0d39cc55fbbd8277065f80
parent055c00f145f9613dd27c8a1e17fb0794f53fc9de (diff)
downloadgcc-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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-decl.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/struct-incompl-1.c7
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" } */
+};