re PR c/27718 (ICE with sizeof of incomplete type)

PR c/27718
	* c-typeck.c (c_expr_sizeof_type): Handle invalid types.

	* gcc.dg/sizeof-1.c: New test.

From-SVN: r114234
This commit is contained in:
Volker Reichelt 2006-05-30 13:33:17 +00:00 committed by Volker Reichelt
parent d91d2db759
commit 16464cc1bb
4 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-05-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/27718
* c-typeck.c (c_expr_sizeof_type): Handle invalid types.
2006-05-30 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/27779

View File

@ -2153,7 +2153,8 @@ c_expr_sizeof_type (struct c_type_name *t)
type = groktypename (t);
ret.value = c_sizeof (type);
ret.original_code = ERROR_MARK;
pop_maybe_used (C_TYPE_VARIABLE_SIZE (type));
pop_maybe_used (type != error_mark_node
? C_TYPE_VARIABLE_SIZE (type) : false);
return ret;
}

View File

@ -1,3 +1,8 @@
2006-05-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/27718
* gcc.dg/sizeof-1.c: New test.
2006-05-30 Uros Bizjak <uros@kss-loka.si>
PR target/27790

View File

@ -0,0 +1,4 @@
/* PR c/27718 */
/* { dg-do compile } */
int i = sizeof(struct A[]); /* { dg-error "incomplete" } */