https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70515
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW Known to fail| |5.3.1, 6.3.0, 7.0 --- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> --- Thank you. I still can't reproduce the problem with -O0 but I do see a SIGSEGV on x86_64 when I compile the test case with -O1 or higher, with all of GCC 5.x, 6.x, and 7.0. Thus confirmed. $ /ssd/build/gcc-6-branch/gcc/xg++ -B /ssd/build/gcc-6-branch/gcc -nostdinc++ -I /ssd/build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I /ssd/build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/include -I /src/gcc/6-branch/libstdc++-v3/libsupc++ -I /src/gcc/6-branch/libstdc++-v3/include/backward -I /src/gcc/6-branch/libstdc++-v3/testsuite/util -L /ssd/build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -std=gnu++1z -g -O1 t.C && gdb -batch -q -ex r -ex bt a.out Program received signal SIGSEGV, Segmentation fault. 0x000000000040064c in <lambda()>::operator() (__closure=0x7fffffffde68) at t.C:9 9 auto lambda1 = [&]{ (*j)++; }; #0 0x000000000040064c in <lambda()>::operator() (__closure=0x7fffffffde68) at t.C:9 #1 <lambda()>::operator() (__closure=0x7fffffffdea0, __closure@entry=0x7fffffffde30) at t.C:10 #2 std::_Function_handler<void(), main()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /ssd/build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/include/functional:1731 #3 0x00000000004006bf in std::function<void ()>::operator()() const (this=0x7fffffffdea0) at /ssd/build/gcc-6-branch/x86_64-pc-linux-gnu/libstdc++-v3/include/functional:2127 #4 main () at t.C:16