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