https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65919
Mikhail Maltsev <maltsevm at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maltsevm at gmail dot com --- Comment #1 from Mikhail Maltsev <maltsevm at gmail dot com> --- Reduced testcase: template <typename> class function; template <typename> class _Base_manager { public: void _M_manager(); template <typename _Tp> static bool _M_not_empty_function(_Tp); }; template <typename, typename> class A; template <typename _Functor, typename... _ArgTypes> class A<void(_ArgTypes...), _Functor> : public _Base_manager<_Functor> {}; template <typename _Res, typename... _ArgTypes> class function<_Res(_ArgTypes...)> { template <typename, typename> using _Requires = int; public: template <typename _Functor, typename = _Requires<_Functor, void>> function(_Functor); }; template <typename _Res, typename... _ArgTypes> template <typename _Functor, typename> function<_Res(_ArgTypes...)>::function(_Functor p1) { A<_Res(), _Functor>::_M_not_empty_function(p1); } struct B { static void do_things(function<void()> = [] {}, function<void()> = [] {}); }; int main() { B::do_things(); }