This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64877] strange warning message from -Waddress
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 18:38:08 +0000
- Subject: [Bug c++/64877] strange warning message from -Waddress
- Auto-submitted: auto-generated
- References: <bug-64877-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64877
--- Comment #2 from Tom Tromey <tromey at gcc dot gnu.org> ---
(In reply to Manuel LÃpez-IbÃÃez from comment #1)
> Hard to say without a minimized testcase.
Yeah.
The original code is here:
https://dxr.mozilla.org/mozilla-central/source/gfx/gl/ScopedGLHelpers.h#35
My attempt to minimize it failed.
Here's what I tried. I can't explain why this doesn't
give any warnings as I would expect one on the second "assert",
based on what the manual says.
template<class Derived>
struct S
{
void m() {
}
S()
{
if (&S<Derived>::Unwrap != &Derived::Unwrap)
m();
if (!(&Derived::UnwrapImpl))
m();
}
void Unwrap() {
}
};
struct T : public S<T>
{
void UnwrapImpl() {
}
};
T t;