From c5e4be6b3645fb2294296310a3705f8be0e75da8 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 20 Apr 2020 13:37:35 -0400 Subject: [PATCH] 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. --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/coroutines.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 + + * coroutines.cc (captures_temporary): Don't assign the result of + STRIP_NOPS to the same variable. + 2020-04-20 Nathan Sidwell 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. */ -- 2.7.4