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;