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++/53921] New: [C++0x] ICE on lambda inside method of class template


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: unassigned@gcc.gnu.org
        ReportedBy: philip.pronin@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).


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