public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47688] New: [C++0x] Segfault when assigning lambda to std::function variable
@ 2011-02-10 19:56 vituscze at gmail dot com
  2011-02-11 19:00 ` [Bug c++/47688] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vituscze at gmail dot com @ 2011-02-10 19:56 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: vituscze@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 <functional>

int main()
{
    std::function <void (int)> 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<void(_ArgTypes
...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor
= main()::<lambda(int&)>, _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()::<lambda(int&)>, _Res = void, _ArgTypes = {int}, typename
std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type =
std::function<void(int)>::_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()::<lambda(int&)>) (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 <http://gcc.gnu.org/bugs.html> for instructions.

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 crash2.cpp -save-temps is in attachment.

Thanks for your time,
Vít Šefl


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/47688] [C++0x] Segfault when assigning lambda to std::function variable
  2011-02-10 19:56 [Bug c++/47688] New: [C++0x] Segfault when assigning lambda to std::function variable vituscze at gmail dot com
@ 2011-02-11 19:00 ` redi at gcc dot gnu.org
  2011-03-15 16:15 ` ramana at gcc dot gnu.org
  2011-03-15 17:07 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-11 19:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 18:58:47 UTC ---
segfault in the same place as PR 47703

*** This bug has been marked as a duplicate of bug 47703 ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/47688] [C++0x] Segfault when assigning lambda to std::function variable
  2011-02-10 19:56 [Bug c++/47688] New: [C++0x] Segfault when assigning lambda to std::function variable vituscze at gmail dot com
  2011-02-11 19:00 ` [Bug c++/47688] " redi at gcc dot gnu.org
@ 2011-03-15 16:15 ` ramana at gcc dot gnu.org
  2011-03-15 17:07 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-03-15 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2011-03-15 16:14:29 UTC ---
Author: ramana
Date: Tue Mar 15 16:14:21 2011
New Revision: 171000

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171000
Log:
Fix PR 47688

2011-03-18  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

    PR target/47668
    gcc/
    * config/arm/arm.md (arm_movtas_ze): Use 'L' instead of 'c'
    in the output template.
    gcc/testsuite/
    * gcc.target/arm/pr47688.c: New.

Added:
    trunk/gcc/testsuite/gcc.target/arm/pr47688.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.md
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/47688] [C++0x] Segfault when assigning lambda to std::function variable
  2011-02-10 19:56 [Bug c++/47688] New: [C++0x] Segfault when assigning lambda to std::function variable vituscze at gmail dot com
  2011-02-11 19:00 ` [Bug c++/47688] " redi at gcc dot gnu.org
  2011-03-15 16:15 ` ramana at gcc dot gnu.org
@ 2011-03-15 17:07 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-03-15 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2011-03-15 17:05:56 UTC ---
Author: ramana
Date: Tue Mar 15 17:05:51 2011
New Revision: 171002

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171002
Log:

Fixup last commit.

Fixed PR target/46788 and not PR 47688


Added:
    trunk/gcc/testsuite/gcc.target/arm/pr46788.c
      - copied unchanged from r171001,
trunk/gcc/testsuite/gcc.target/arm/pr47688.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-15 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 19:56 [Bug c++/47688] New: [C++0x] Segfault when assigning lambda to std::function variable vituscze at gmail dot com
2011-02-11 19:00 ` [Bug c++/47688] " redi at gcc dot gnu.org
2011-03-15 16:15 ` ramana at gcc dot gnu.org
2011-03-15 17:07 ` ramana at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).