http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52619
Bug #: 52619
Summary: ICE/segmentation fault in lambda function
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Hi, the following piece of code causes an ICE (segmentation fault) when
compiled with gcc-4.7.0-RC-20120302 (no problem with gcc 4.6.3):
#include <atomic>
template<typename T>
struct test {
std::atomic<int> x;
void foo() {
auto cond = [this] {return x != 0;};
}
};
It works if the value of x is loaded explicitly:
auto cond = [this] {return x.load() != 0;};