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++/81408] Lots of new -Wunsafe-loop-optimizations warnings with 7 compared to 6


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81408

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
And there's sample which started to be reported with Bin's revision r238641:

namespace a {
void b () __attribute__ ((__noreturn__));
template <typename> struct d;
template <typename e> struct d<e *>
{
  typedef e f;
};
struct g
{
  template <typename h> using i = h *;
};
}
using a::d;
template <typename j, typename> class k
{
  j l;

public:
  typename d<j>::f operator* () {}
  void operator++ () { ++l; }
  j
  aa ()
  {
    return l;
  }
};
template <typename m, typename n, typename ab>
bool
operator!= (k<m, ab> o, k<n, ab> p2)
{
  return o.aa () != p2.aa ();
}
struct p;
namespace a {
struct F
{
  struct q
  {
    using ai = g::i<p>;
  };
  using r = q::ai;
};
class H
{
public:
  k<F::r, int> begin ();
  k<F::r, int> end ();
};
int s;
class I
{
public:
  void
  aq (char)
  {
    if (s)
      b ();
  }
};
class u : public I
{
public:
  void
  operator<< (u o (u))
  {
    o (*this);
  }
  u operator<< (void *);
};
template <typename at, typename au>
at
av (au o)
{
  o.aq ('\n');
}
u ax;
}
struct p
{
  char *ay;
};
a::H t;
void
ShowHelpListCommands ()
{
  for (auto c : t)
    a::ax << c.ay << a::av;
}

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