This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81408] Lots of new -Wunsafe-loop-optimizations warnings with 7 compared to 6
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Jul 2017 10:16:40 +0000
- Subject: [Bug c++/81408] Lots of new -Wunsafe-loop-optimizations warnings with 7 compared to 6
- Auto-submitted: auto-generated
- References: <bug-81408-4@http.gcc.gnu.org/bugzilla/>
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;
}