[Bug c++/54764] New: In class initialization of non-static lambda member can't be used in class with default template paramer
leonid at volnitsky dot com
gcc-bugzilla@gcc.gnu.org
Mon Oct 1 06:43:00 GMT 2012
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: unassigned@gcc.gnu.org
ReportedBy: leonid@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;};
^
More information about the Gcc-bugs
mailing list