From: Mark Mitchell Date: Thu, 30 Dec 2004 00:31:00 +0000 (+0000) Subject: re PR c++/19190 (warning "value computed is not used" emitted too often) X-Git-Tag: releases/gcc-4.0.0~1884 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9fa123367aeaf3cf316d4c0c3bcd8dea047dee8;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9e96120e8083..4be3133931d3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2004-12-29 Mark Mitchell + + PR c++/19190 + * cvt.c (convert_to_void): Do not use STRIP_NOPs. + 2004-12-28 Richard Henderson PR inline-asm/15740 diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index b68cf0fd5b7b..a3ec5d45a738 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f7208334c904..35125e4ee787 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-12-29 Mark Mitchell + + PR c++/19190 + * g++.dg/warn/Wunused-10.C: New test. + 2004-12-28 Richard Henderson * objc.dg/stabs-1.m: Disable for alpha. diff --git a/gcc/testsuite/g++.dg/warn/Wunused-10.C b/gcc/testsuite/g++.dg/warn/Wunused-10.C new file mode 100644 index 000000000000..d2d6a343dab9 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wunused-10.C @@ -0,0 +1,8 @@ +// PR c++/19190 +// { dg-options "-Wunused" } + +struct breakme +{ + void setAction( unsigned char a ) { act = a; } + unsigned int act:8; +};