This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/39803] New: Bogus 'unused value' warning on declarations of non-POD arrays
- From: "lcwu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Apr 2009 23:05:37 -0000
- Subject: [Bug c++/39803] New: Bogus 'unused value' warning on declarations of non-POD arrays
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When compiling the following program using the mainline GCC (4.5) with -Wunused
flag, we get a bogus "unused value" warning on the array declaration:
$ cat Wunused-14.C
#include <utility>
using std::pair;
int foo() {
pair<int, const char*> components[3];
components[0].first = 0;
return 0;
}
$ g++ -Wunused -c Wunused-14.C
Wunused-14.C: In function 'int foo()':
Wunused-14.C:6: warning: value computed is not used
Here is the version string of the compiler used:
Target: x86_64-unknown-linux-gnu
gcc version 4.5.0 20090414 (experimental) (GCC)
--
Summary: Bogus 'unused value' warning on declarations of non-POD
arrays
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lcwu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39803