Commit 686e2237 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/69796 (ICE on invalid code in useless_type_conversion_p, at gimple-expr.c:83)

	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
parent f8e4188c
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
......
......@@ -1436,10 +1436,7 @@ c_parser_translation_unit (c_parser *parser)
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.
......
/* 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" } */
}
/* 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment