mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 11:49:40 +08:00
* typeck.c (convert_for_assignment): Warn about conversion to bool.
From-SVN: r32285
This commit is contained in:
parent
78067f1634
commit
36de3a5d10
@ -1,3 +1,7 @@
|
||||
2000-03-01 Cor Veenman <C.J.Veenman@its.tudelft.nl>
|
||||
|
||||
* typeck.c (convert_for_assignment): Warn about conversion to bool.
|
||||
|
||||
2000-03-01 Bernd Schmidt <bernds@cygnus.co.uk>
|
||||
|
||||
* typeck.c (maybe_warn_about_returning_address_of_local): Reorganize
|
||||
|
@ -6487,6 +6487,15 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
|
||||
else
|
||||
cp_warning ("%s to `%T' from `%T'", errtype, type, rhstype);
|
||||
}
|
||||
/* And warn about assigning non-BOOLEAN_TYPE to BOOLEAN_TYPE. */
|
||||
else if (coder != BOOLEAN_TYPE && codel == BOOLEAN_TYPE)
|
||||
{
|
||||
if (fndecl)
|
||||
cp_warning ("`%T' used for argument %P of `%D'",
|
||||
rhstype, parmnum, fndecl);
|
||||
else
|
||||
cp_warning ("%s to `%T' from `%T'", errtype, type, rhstype);
|
||||
}
|
||||
/* And warn about assigning a negative value to an unsigned
|
||||
variable. */
|
||||
else if (TREE_UNSIGNED (type) && codel != BOOLEAN_TYPE)
|
||||
|
Loading…
Reference in New Issue
Block a user