aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-12-30 00:31:00 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-12-30 00:31:00 +0000
commitd9fa123367aeaf3cf316d4c0c3bcd8dea047dee8 (patch)
treed04e684098be16fada657ab84d0137889a239e9b /gcc/cp/cvt.c
parentd98fd13429d8819de437e6a681aebea99e3edbfe (diff)
downloadgcc-d9fa123367aeaf3cf316d4c0c3bcd8dea047dee8.zip
gcc-d9fa123367aeaf3cf316d4c0c3bcd8dea047dee8.tar.gz
gcc-d9fa123367aeaf3cf316d4c0c3bcd8dea047dee8.tar.bz2
re PR c++/19190 (warning "value computed is not used" emitted too often)
PR c++/19190 * cvt.c (convert_to_void): Do not use STRIP_NOPs. PR c++/19190 * g++.dg/warn/Wunused-10.C: New test. From-SVN: r92721
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index b68cf0f..a3ec5d4 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -929,8 +929,11 @@ convert_to_void (tree expr, const char *implicit)
turned into a call to "__builtin_memcpy", with a
conversion of the return value to an appropriate
type.) So, to avoid false positives, we strip
- conversions. */
- STRIP_NOPS (e);
+ conversions. Do not use STRIP_NOPs because it will
+ not strip conversions to "void", as that is not a
+ mode-preserving conversion. */
+ while (TREE_CODE (e) == NOP_EXPR)
+ e = TREE_OPERAND (e, 0);
code = TREE_CODE (e);
class = TREE_CODE_CLASS (code);