summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/cp/typeck.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/gcc/cp/typeck.c b/contrib/gcc/cp/typeck.c
index 6b28f49..dd92b22 100644
--- a/contrib/gcc/cp/typeck.c
+++ b/contrib/gcc/cp/typeck.c
@@ -3773,6 +3773,12 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
result = fold_if_not_in_template (result);
if (final_type != 0)
result = cp_convert (final_type, result);
+
+ if (TREE_OVERFLOW_P (result)
+ && !TREE_OVERFLOW_P (op0)
+ && !TREE_OVERFLOW_P (op1))
+ overflow_warning (result);
+
return result;
}
OpenPOWER on IntegriCloud