aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-04-20 13:37:35 -0400
committerMarek Polacek <polacek@redhat.com>2020-04-20 15:19:16 -0400
commitc5e4be6b3645fb2294296310a3705f8be0e75da8 (patch)
tree4b9fda31076b67fb56a3e99201ac94c1f92ebd46 /gcc
parent582fe481f4bb800f822035b8a17000d0efaecef4 (diff)
downloadgcc-c5e4be6b3645fb2294296310a3705f8be0e75da8.zip
gcc-c5e4be6b3645fb2294296310a3705f8be0e75da8.tar.gz
gcc-c5e4be6b3645fb2294296310a3705f8be0e75da8.tar.bz2
coroutines: Fix STRIP_NOPS usage.
parm = STRIP_NOPS (parm); is unnecessary and generates warning: operation on 'parm' may be undefined [-Wsequence-point] when cp/coroutines.cc is compiled with -std=c++11. * coroutines.cc (captures_temporary): Don't assign the result of STRIP_NOPS to the same variable.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/coroutines.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e210eb5..891ec79 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-20 Marek Polacek <polacek@redhat.com>
+
+ * coroutines.cc (captures_temporary): Don't assign the result of
+ STRIP_NOPS to the same variable.
+
2020-04-20 Nathan Sidwell <nathan@acm.org>
PR 94454 - tpl-tpl-parms are not canonicalizable types
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 0a8e752..ceb8daa 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -2652,7 +2652,7 @@ captures_temporary (tree *stmt, int *do_subtree, void *d)
parm = TREE_OPERAND (parm, 0);
if (TREE_CODE (parm) == INDIRECT_REF)
parm = TREE_OPERAND (parm, 0);
- parm = STRIP_NOPS (parm);
+ STRIP_NOPS (parm);
}
/* This isn't a temporary. */