[Bug c++/47687] New: [C++0x] Crash on a lambda returning a lambda (using std::function)

2011-02-10 Thread vituscze at gmail dot com
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: unassig...@gcc.gnu.org
ReportedBy: vitus...@gmail.com


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 
using std::function;
typedef function int_int_f;

int_int_f a = [] (int x)
{
return x + 3;
};

function 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 .
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


[Bug c++/47688] New: [C++0x] Segfault when assigning lambda to std::function variable

2011-02-10 Thread vituscze at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47688

   Summary: [C++0x] Segfault when assigning lambda to
std::function variable
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: vitus...@gmail.com


Created attachment 23301
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23301
Output of -save-temps

Hello,

g++ crashes while compiling following code (if it is of any use):

#include 

int main()
{
std::function  f = [] (int& x) // type mismatch on purpose
{
x += 3;
};
}

Command line:
g++ -std=c++0x -Wall crash2.cpp

Compiler crashes with following error:
In file included from crash2.cpp:1:0:
c:\gcc\bin\../lib/gcc/i686-pc-mingw32/4.6.0/../../../../include/c++/4.6.0/functional:
In static member function 'static void std::_Function_handler::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor
= main()::, _ArgTypes = {int}]':
c:\gcc\bin\../lib/gcc/i686-pc-mingw32/4.6.0/../../../../include/c++/4.6.0/functional:2135:6:
  instantiated from 'std::function<_Res(_ArgTypes ...)>::function(_Functor,
typename std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type) [with _Functor =
main()::, _Res = void, _ArgTypes = {int}, typename
std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type =
std::function::_Useless]'
crash2.cpp:8:2:   instantiated from here
c:\gcc\bin\../lib/gcc/i686-pc-mingw32/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
error: no match for call to '(main()::) (int)'
crash2.cpp:5:34: note: candidates are:
c:\gcc\bin\../lib/gcc/i686-pc-mingw32/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

Using GCC 4.6.0 20110205 on Windows Vista (32bit).

Output of g++ -v:
Built by Equation Solution .
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 crash2.cpp -save-temps is in attachment.

Thanks for your time,
Vít Šefl


[Bug c++/49996] New: Internal error in verify_gimple_stmt: initializing struct in new-initializer

2011-08-05 Thread vituscze at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49996

   Summary: Internal error in verify_gimple_stmt: initializing
struct in new-initializer
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: vitus...@gmail.com


Created attachment 24927
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24927
-save-temps, bug.s contains `.file "bug.cpp"` only

Hello there,

g++ crashes while compiling following code:

struct A
{
  ~A()
  { }
};

struct B
{
  const A& ref;
};

int main()
{
  B* p = new B{A()};
}

Here's complete error message:

bug.cpp: In function 'int main()':
bug.cpp:12:5: internal compiler error: in verify_gimple_stmt, at
tree-cfg.c:4056
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

Command line:
g++ bug.cpp -o bug -std=c++0x

Output of g++ -v:
Built by Equation Solution .
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=d:/gcc/bin/../libexec/gcc/i686-pc-mingw32/4.7.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../gcc-4.7-20110730-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.7-20110730
--with-gcc --with-gnu-as --with-gnu-ld --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.7-20110730
--disable-shared --disable-nls --disable-tls --disable-win32-registry
--enable-libquadmath-support --enable-libquadmath
--enable-languages=c,c++,fortran --enable-libgomp --enable-threads=win32
--enable-lto --enable-static --enable-shared=lto-plugin --enable-plugins
--enable-ld=yes --enable-cloog-backend=ppl
Thread model: win32
gcc version 4.7.0 20110730 (experimental) (GCC)

Output of -save-temps is in attachment, 'bug.s' contains '.file "bug.cpp"'
only.

Thanks for your time,
Vít Šefl