https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62219
Bug ID: 62219 Summary: [c++11] Spurious error for lambda in a friend function of a class template with a default template parameters Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eric.niebler at gmail dot com This code: template< class = void > struct S { friend void foo( S ) { [](){}; } }; Gives me: test.cpp: In function ‘void foo(S< <template-parameter-1-1> >)’: test.cpp:6:8: error: default argument for template parameter for class enclosing ‘foo(S< <template-parameter-1-1> >)::<lambda>’ [](){}; ^ I'm not sure what the error is trying to tell me. FWIW, the code compiles cleanly with clang.