convert.c (convert_to_integer): Issue an error on conversions to incomplete types.

* convert.c (convert_to_integer): Issue an error on conversions to
	incomplete types.

From-SVN: r22102
This commit is contained in:
Mark Mitchell 1998-08-30 16:04:17 +00:00 committed by Mark Mitchell
parent 3103b7db04
commit 9c4cb3a3e9
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Sun Aug 30 16:05:45 1998 Mark Mitchell <mark@markmitchell.com>
* convert.c (convert_to_integer): Issue an error on conversions to
incomplete types.
Sun Aug 30 16:47:20 1998 Martin von Lvwis <loewis@informatik.hu-berlin.de>
* Makefile.in: Add lang_tree_files and gencheck.h.

View File

@ -121,6 +121,14 @@ convert_to_integer (type, expr)
int inprec = TYPE_PRECISION (intype);
int outprec = TYPE_PRECISION (type);
/* An INTEGER_TYPE cannot be incomplete, but an ENUMERAL_TYPE can
be. Consider `enum E = { a, b = (enum E) 3 };'. */
if (!TYPE_SIZE (type))
{
error ("conversion to incomplete type");
return error_mark_node;
}
switch (TREE_CODE (intype))
{
case POINTER_TYPE: