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++/53137] New: g++ segfault


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53137

             Bug #: 53137
           Summary: g++ segfault
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: valery.bickov@gmail.com


4.7.0 and 4.8 segfaults on Linux x86-64 with the following code:

template <typename STORE>
void getParent(STORE& tStore)
{
}

struct Store
{
    template <typename CheckParentFunc>
    void updateChildCommon(CheckParentFunc c);

    template <typename T>
    int& getStore();

    template <typename T>
    void updateChild(const T& obj)
    {
        updateChildCommon([this] () { getParent(getStore<T>()); });
    }

    void update(int obj)
    {
        updateChild(obj);
    }
};

$ /usr/local/gcc-4.7.0/bin/g++ gcc-4.7.0-crash.cpp -std=c++11 
gcc-4.7.0-crash.cpp: In instantiation of 'Store::updateChild(const T&) [with T
= int]::<lambda()>':
gcc-4.7.0-crash.cpp:17:28:   required from 'struct Store::updateChild(const T&)
[with T = int]::<lambda()>'
gcc-4.7.0-crash.cpp:17:9:   required from 'void Store::updateChild(const T&)
[with T = int]'
gcc-4.7.0-crash.cpp:22:24:   required from here
gcc-4.7.0-crash.cpp:17:39: 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.

$ /usr/local/gcc-4.7.0/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-4.7.0/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.7.0/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc-4.7.0 --disable-multilib
--enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 (GCC)


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