https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64382
Bug ID: 64382 Summary: ICE due to use of `this` inside a lambda that captures everything by ref inside a member function of a class template Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lh_mouse at 126 dot com template<typename T> struct my_queue { void push(T){ } void ice(){ trav([&](auto &&v){ push(v); }); } template<typename F> void trav(F &&f){ f(T()); } }; template class my_queue<int>; --------------------------------------------------------- E:\Desktop>g++ -c test.cpp -std=c++14 test.cpp: In lambda function: test.cpp:6:29: internal compiler error: Segmentation fault trav([&](auto &&v){ push(v); }); ^ Please submit a full bug report, with preprocessed source if appropriate. See <http://sourceforge.net/projects/mingw-w64> for instructions.