]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/26818 (tree check: expected class ‘type’, have ‘exceptional’ (error_mark...
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 22 May 2006 12:20:41 +0000 (12:20 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 22 May 2006 12:20:41 +0000 (12:20 +0000)
PR c/26818
* c-decl.c (finish_struct): Skip erroneous fields.

* gcc.dg/struct-incompl-1.c: New test.

From-SVN: r113975

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/struct-incompl-1.c [new file with mode: 0644]

index 281fdc345a7fe8883ebaf8cb23a7a1fc84ece0d5..5fb269ec70f6ad9dea4f07717a1b7f4289f680f6 100644 (file)
@@ -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.
index 9ece1ce764d633b6f7c165d6eeb55955587f14f3..d7362c10896e057990c57e2135f36719411071c2 100644 (file)
@@ -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)
index 84771312fe28f47a312df5f071895de34b7f69bd..a1c67031302a1d32e4e2edeceda030c54fc4e3ea 100644 (file)
@@ -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 (file)
index 0000000..c32b2d5
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR c/26818 */
+/* { dg-do compile } */
+
+struct __attribute__ ((packed)) A
+{
+  struct B b; /* { dg-error "incomplete" } */
+};