typeck.c (build_static_cast): Don't strip target qualifiers when casting from a class.

* typeck.c (build_static_cast): Don't strip target qualifiers
	when casting from a class.

From-SVN: r31236
This commit is contained in:
Nathan Sidwell 2000-01-05 10:10:53 +00:00 committed by Nathan Sidwell
parent 5ed75fe4f4
commit c0d2229e90
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2000-01-05 Nathan Sidwell <nathan@acm.org>
* typeck.c (build_static_cast): Don't strip target qualifiers
when casting from a class.
2000-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (warn_hidden): Initialize variable `fndecl'.

View File

@ -1,5 +1,5 @@
/* Build expressions with type checking for C++ compiler.
Copyright (C) 1987, 88, 89, 92-98, 1999 Free Software Foundation, Inc.
Copyright (C) 1987, 88, 89, 92-99, 2000 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@ -5183,8 +5183,10 @@ build_static_cast (type, expr)
/* FIXME handle casting to array type. */
ok = 0;
if (can_convert_arg (strip_all_pointer_quals (type),
strip_all_pointer_quals (intype), expr))
if (IS_AGGR_TYPE (intype)
? can_convert_arg (type, intype, expr)
: can_convert_arg (strip_all_pointer_quals (type),
strip_all_pointer_quals (intype), expr))
ok = 1;
else if (TYPE_PTROB_P (type) && TYPE_PTROB_P (intype))
{