2016-10-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-common.c (c_common_truthvalue_conversion): Warn only for signed
integer shift ops in boolean context.
===================================================================
@@ -3328,8 +3328,10 @@
TREE_OPERAND (expr, 0));
case LSHIFT_EXPR:
- warning_at (EXPR_LOCATION (expr), OPT_Wint_in_bool_context,
- "<< in boolean context, did you mean '<' ?");
+ if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
+ && !TYPE_UNSIGNED (TREE_TYPE (expr)))
+ warning_at (EXPR_LOCATION (expr), OPT_Wint_in_bool_context,
+ "<< in boolean context, did you mean '<' ?");
break;
case COND_EXPR: