https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64877
Bug ID: 64877 Summary: strange warning message from -Waddress Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tromey at gcc dot gnu.org I found a spot in firefox that tries to prevent hiding using: explicit ScopedGLWrapper(GLContext* gl) : mIsUnwrapped(false) , mGL(gl) { MOZ_ASSERT(&ScopedGLWrapper<Derived>::Unwrap == &Derived::Unwrap); [...] void Unwrap() { ... } gcc 5 warns about this assert: /home/tromey/firefox-git/gecko-dev/gfx/gl/ScopedGLHelpers.h:35:54: error: the address of ‘void mozilla::gl::ScopedGLWrapper<Derived>::Unwrap() [with Derived = mozilla::gl::ScopedGLState]’ will never be NULL [-Werror=address] MOZ_ASSERT(&ScopedGLWrapper<Derived>::Unwrap == &Derived::Unwrap); ^ The message here is strange. Whether or not the address can be NULL is not an issue. I don't see why -Waddress ought to warn here at all.