https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61566
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> --- In fact, it seems to me that something is going wrong with the context: I don't see why isn't just a PARM_DECL, as happens for a non-template version of foo. Better if Jason looks into the issue... This is a slightly more compact testcase: struct function { template < typename _Functor> function (_Functor); }; struct C { template <typename T> void foo (T, function = [] {}); }; void bar () { C c; c.foo (1); }