This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71442] [5/6/7 Regression] r232569 breaks -Wunused-*


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]