http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54764
Bug #: 54764 Summary: In class initialization of non-static lambda member can't be used in class with default template paramer Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: leo...@volnitsky.com Clang-3.2 compiles (FWIW), but rejected by GCC 4.7.1 and 4.8: ------------------------------------------------------------------ #include <functional> template<class T=void> struct c{ std::function<int(int)> f = [](int i){return i+i;}; }; int main() {} ------------------------------------------------------------------- Error message: t.cc:6:31: error: default argument for template parameter for class enclosing ‘struct __lambda0’ function<int(int)> f = [](int i){return i+i;}; ^