This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54764] New: In class initialization of non-static lambda member can't be used in class with default template paramer
- From: "leonid at volnitsky dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 01 Oct 2012 06:43:26 +0000
- Subject: [Bug c++/54764] New: In class initialization of non-static lambda member can't be used in class with default template paramer
- Auto-submitted: auto-generated
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;};
^