http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52302
Bug #: 52302 Summary: [4.6.2] cc1plus.exe hungs when compiling Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: x...@hotmail.com trying to compile this code cc1plus hungs, and when debugging in Visual Studio, debugger catches stackoverflow exception. gcc 4.6.2 cpp.cpp: #include <iostream> #include <functional> void open(std::function<void()> callback) { callback(); } void read(std::function<void()> callback) { auto opencb = ([&]() { int x = 0; return [=]() mutable { x++; callback(); }; })(); open(opencb); } int main(int argc, char **argv) { read([]() {}); return 0; } command line: >g++ -c cpp.cpp -g -Wall -Wextra -std=c++0x -o cpp.o