mirror of git://gcc.gnu.org/git/gcc.git
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:
parent
3103b7db04
commit
9c4cb3a3e9
|
|
@ -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>
|
Sun Aug 30 16:47:20 1998 Martin von Lvwis <loewis@informatik.hu-berlin.de>
|
||||||
|
|
||||||
* Makefile.in: Add lang_tree_files and gencheck.h.
|
* Makefile.in: Add lang_tree_files and gencheck.h.
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,14 @@ convert_to_integer (type, expr)
|
||||||
int inprec = TYPE_PRECISION (intype);
|
int inprec = TYPE_PRECISION (intype);
|
||||||
int outprec = TYPE_PRECISION (type);
|
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))
|
switch (TREE_CODE (intype))
|
||||||
{
|
{
|
||||||
case POINTER_TYPE:
|
case POINTER_TYPE:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue