PR c/69796
PR c/69974
* c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
of incomplete decls to error_mark_node.
* gcc.dg/pr69796.c: New test.
* gcc.dg/pr69974.c: New test.
From-SVN: r233861
+2016-03-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/69796
+ PR c/69974
+ * c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
+ of incomplete decls to error_mark_node.
+
2016-02-24 Marek Polacek <polacek@redhat.com>
PR c/69819
tree decl;
FOR_EACH_VEC_ELT (incomplete_record_decls, i, decl)
if (DECL_SIZE (decl) == NULL_TREE && TREE_TYPE (decl) != error_mark_node)
- {
- error ("storage size of %q+D isn%'t known", decl);
- TREE_TYPE (decl) = error_mark_node;
- }
+ error ("storage size of %q+D isn%'t known", decl);
}
/* Parse an external declaration (C90 6.7, C99 6.9).
+2016-03-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/69796
+ PR c/69974
+ * gcc.dg/pr69796.c: New test.
+ * gcc.dg/pr69974.c: New test.
+
2016-03-01 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/stack_usage3.adb: Robustify and enable for all targets.
--- /dev/null
+/* PR c/69796 */
+/* { dg-do compile } */
+
+struct S s; /* { dg-error "storage size of 's' isn't known" } */
+
+void
+foo ()
+{
+ s a; /* { dg-error "expression statement has incomplete type|expected" } */
+}
--- /dev/null
+/* PR c/69974 */
+/* { dg-do compile } */
+
+struct S;
+char foo (struct S *);
+struct S a; /* { dg-error "storage size of 'a' isn't known" } */
+int b;
+
+void
+bar ()
+{
+ b &= foo (&a);
+}