This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52619] New: ICE/segmentation fault in lambda function
- From: "t.schuele at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Mar 2012 15:23:13 +0000
- Subject: [Bug c++/52619] New: ICE/segmentation fault in lambda function
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: t.schuele@web.de
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;};