@@ -650,8 +650,8 @@ cp_convert_and_check (tree type, tree expr, tsubst_flags_t complain)
folded_result = fold_simple (folded_result);
if (!TREE_OVERFLOW_P (folded)
&& folded_result != error_mark_node)
- warnings_for_convert_and_check (input_location, type, folded,
- folded_result);
+ warnings_for_convert_and_check (EXPR_LOC_OR_LOC (expr, input_location),
+ type, folded, folded_result);
}
return result;
@@ -62,9 +62,9 @@ void func3()
/* At least one branch of ? does not fit in the destination, thus
warn. */
uchar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
- uchar_x = bar != 0 /* { dg-warning "negative integer implicitly converted to unsigned type" } */
- ? (unsigned char) 1024
- : -1;
+ uchar_x = bar != 0
+ ? (unsigned char) 1024 /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ : -1;
}
void func4()