This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52619] New: ICE/segmentation fault in lambda function


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;};


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]