http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57464
Bug ID: 57464 Summary: c++11 crate a std::function object with lambda expr Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lilijreey at 126 dot com Created attachment 30223 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30223&action=edit codes //BUG report //GCC4.6.4 compiling crash //OS ubuntu-12.04-X86 //uname Linux 3.2.0-43-generic #68-Ubuntu SMP Wed May 15 03:33:33 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux //g++ -Wall -std=c++0x cpp_function_bug.cpp #include <stdio.h> #include <functional> int main(void) { std::function<std::function<int()>(int)> rclouse = [](int i) { return [&i](){++i;}; }; std::function<int()> seed3 = rclouse(3); printf("%d\n", seed3()); }