http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53921
Bug #: 53921 Summary: [C++0x] ICE on lambda inside method of class template Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: philip.pro...@gmail.com $ g++ -std=c++0x -Wall -Wextra bug.cpp bug.cpp: In lambda function: bug.cpp:6:34: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. g++ --version g++ (GCC) 4.7.1 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. void bar(int) { } template <class X> struct B { void foo() { auto c = [this]() { bar(value); }; } int value; }; Additional info: not reproducible using gcc 4.6.2. Successfully compiles if you access 'value' using 'this' (this->value).