// PR c++/49663 struct Nosm { int m_R; }; namespace dx { struct onc { typedef void(*Cb)(); onc(Cb cb); }; struct grac { template static void once(); }; template struct tonc : onc { tonc() : onc(&grac::once) {} static Derived& get(); }; template void grac::once() { tonc::get().h(); } } namespace { template struct has_R { }; template inline void setR(T* m, has_R* = 0) { } inline void setR(...) { } } template struct Qmi : dx::tonc > { void h() { setR(&msg); } M msg; }; Qmi x;