This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71442] [5/6/7 Regression] r232569 breaks -Wunused-*
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Jun 2016 08:18:34 +0000
- Subject: [Bug c++/71442] [5/6/7 Regression] r232569 breaks -Wunused-*
- Auto-submitted: auto-generated
- References: <bug-71442-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71442
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Oops, you're right.
But e.g.
// { dg-do compile { target c++11 } }
// { dg-options "-Wunused-variable" }
struct C
{
template<typename... Ts>
int operator()(Ts &&...)
{
return sizeof...(Ts);
}
};
int
foo ()
{
C {} (1, 1L, 1LL, 1.0);
}
template<int N>
void
bar ()
{
char a; // { dg-warning "unused variable" }
short b; // { dg-warning "unused variable" }
int c; // { dg-warning "unused variable" }
long d; // { dg-warning "unused variable" }
long long e; // { dg-warning "unused variable" }
float f; // { dg-warning "unused variable" }
double g; // { dg-warning "unused variable" }
}
void
baz ()
{
bar <0> ();
}
reproduces it. Will adjust the patch.
The original testcase has been
#include <tuple>
int f ()
{
std::tuple<int> int_tuple;
int aaa;
double ccc;
std::tuple<double> double_tuple;
return -1;
}
but that uses libstdc++ headers.