aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-05-01 19:19:44 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-05-01 19:19:44 +0000
commit1a989b6179c0a10892785658443e93507dc597ee (patch)
tree508a2f6b25799edf4c0ed0c43034da30fd462ef4 /gcc/cp
parent36ff9dfbbec06afc69c642ff460abbd4cbbd78e1 (diff)
downloadgcc-1a989b6179c0a10892785658443e93507dc597ee.zip
gcc-1a989b6179c0a10892785658443e93507dc597ee.tar.gz
gcc-1a989b6179c0a10892785658443e93507dc597ee.tar.bz2
re PR c++/57132 (spurious warning: division by zero [-Wdiv-by-zero] in if (m) res %=m;)
/cp 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57132 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease c_inhibit_evaluation_warnings around build_x_modify_expr call. /testsuite 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57132 * g++.dg/warn/Wdiv-by-zero-bogus-2.C: New. From-SVN: r198504
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c9
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 09f10df..e4996fb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
+ PR c++/57132
+ * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
+ c_inhibit_evaluation_warnings around build_x_modify_expr call.
+
+2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/57092
* semantics.c (finish_decltype_type): Handle instantiated template
non-type arguments.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 57f65b3..33ab292 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13810,7 +13810,11 @@ tsubst_copy_and_build (tree t,
case MODOP_EXPR:
{
- tree r = build_x_modify_expr
+ tree r;
+
+ ++c_inhibit_evaluation_warnings;
+
+ r = build_x_modify_expr
(EXPR_LOCATION (t),
RECUR (TREE_OPERAND (t, 0)),
TREE_CODE (TREE_OPERAND (t, 1)),
@@ -13824,6 +13828,9 @@ tsubst_copy_and_build (tree t,
here. */
if (TREE_NO_WARNING (t))
TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
+
+ --c_inhibit_evaluation_warnings;
+
RETURN (r);
}