http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47687
Summary: [C++0x] Crash on a lambda returning a lambda (using
std::function)
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 23300
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23300
Output of -save-temps
Hello,
cc1plus.exe crashes (together with Windows prompt "Program has stopped
working...") while compiling the following code (if it is of any use):
#include <functional>
using std::function;
typedef function<int (int)> int_int_f;
int_int_f a = [] (int x)
{
return x + 3;
};
function<int_int_f (int_int_f)> b = [] (int_int_f f)
{
return [=] (int x)
{
return f(x) * f(x);
};
};
int main()
{ }
Command line:
g++ -std=c++0x -Wall crash.cpp
Compiler produces no warnings or errors.
Using GCC 4.6.0 20110205 on Windows Vista (32bit).
Output of g++ -v:
Built by Equation Solution <http://www.Equation.com>.
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/gcc/bin/../libexec/gcc/i686-pc-mingw32/4.6.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../gcc-4.6-20110205-mingw/configure --host=i686-pc-mingw32
--build=x86_64-unknown-linux-gnu --target=i686-pc-mingw32
--prefix=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/gcc/4.6-20110205
--with-lto-plugin --with-gcc --with-gnu-ld --with-gnu-as
--with-host-libstdcxx='-lstdc++ -lsupc++ -lm'
--with-ppl=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/ppl
--with-cloog=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/cloog
--with-gmp=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/gmp
--with-mpfr=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/mpfr
--with-mpc=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/mpc
--with-sysroot=/home/gfortran/gcc-home/binary/mingw32/cross/x86_32/gcc/4.6-20110205
--enable-languages=c,c++,fortran --enable-libgomp --enable-threads=win32
--enable-lto --enable-static --enable-cloog-backend=ppl --disable-shared
--disable-nls --disable-tls --disable-win32-registry
Thread model: win32
gcc version 4.6.0 20110205 (experimental) (GCC)
Output of g++ -std=c++0x crash.cpp -save-temps is in attachment.
Thanks for your time,
Vít Šefl