public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
@ 2011-02-11 18:11 erik.sandbraaten at gmail dot com
  2011-02-11 18:56 ` [Bug c++/47703] " redi at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: erik.sandbraaten at gmail dot com @ 2011-02-11 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 Regression] [C++0x] ICE: std::sort chokes on
                    simple lambda function
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: erik.sandbraaten@gmail.com


The following code test.cc :

#include <algorithm>
#include <vector>

int main()
{
    std::vector<int> vec;

    std::sort(vec.begin(), vec.end(), [](int& t1, int& t2) {return t1 < t2;});

    return 0;
}

Results in:

~/c++bug$ g++ -std=c++0x test.cc -o test
In file included from
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/algorithm:63:0,
                 from test.cc:1:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algo.h:
In function ‘_RandomAccessIterator
std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const
_Tp&, _Compare) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Tp = int, _Compare =
main()::<lambda(int&, int&)>]’:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algo.h:2265:78:
  instantiated from ‘_RandomAccessIterator
std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator,
_Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<int*,
std::vector<int> >, _Compare = main()::<lambda(int&, int&)>]’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algo.h:2306:62:
  instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Size = int, _Compare =
main()::<lambda(int&, int&)>]’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algo.h:5341:4:
  instantiated from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare =
main()::<lambda(int&, int&)>]’
test.cc:8:77:   instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algo.h:2233:4:
error: no match for call to ‘(main()::<lambda(int&, int&)>) (int&, const int&)’
test.cc:8:40: note: candidates are:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_algo.h:2233:4:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure -v --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20110205 (experimental) (GCC)


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
@ 2011-02-11 18:56 ` redi at gcc dot gnu.org
  2011-02-11 19:00 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-11 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.02.11 18:54:51
     Ever Confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 18:54:51 UTC ---
confirmed, segfaults while printing list of candidates


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
  2011-02-11 18:56 ` [Bug c++/47703] " redi at gcc dot gnu.org
@ 2011-02-11 19:00 ` redi at gcc dot gnu.org
  2011-02-11 19:02 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ 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=47703

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vituscze at gmail dot com

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 18:58:47 UTC ---
*** Bug 47688 has been marked as a duplicate of this bug. ***


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
  2011-02-11 18:56 ` [Bug c++/47703] " redi at gcc dot gnu.org
  2011-02-11 19:00 ` redi at gcc dot gnu.org
@ 2011-02-11 19:02 ` redi at gcc dot gnu.org
  2011-02-11 19:07 ` froydnj at codesourcery dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-11 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 18:59:56 UTC ---
Program received signal SIGSEGV, Segmentation fault.
0x00000000005520db in location_of (t=0x0) at
../../gcc-4.6-20110205/gcc/cp/error.c:2496
2496    ../../gcc-4.6-20110205/gcc/cp/error.c: No such file or directory.
        in ../../gcc-4.6-20110205/gcc/cp/error.c
(gdb) bt
#0  0x00000000005520db in location_of (t=0x0) at
../../gcc-4.6-20110205/gcc/cp/error.c:2496
#1  0x000000000048baa3 in print_z_candidate (msgstr=0x0, candidate=0x1583700)
at ../../gcc-4.6-20110205/gcc/cp/call.c:2969
#2  0x000000000048c0fa in print_z_candidates (loc=8815952,
candidates=0x1583700) at ../../gcc-4.6-20110205/gcc/cp/call.c:3074
#3  0x000000000049f7bc in build_op_call (obj=0x2aaaac6a6880,
args=0x7fffffffddf0, complain=<value optimized out>) at
../../gcc-4.6-20110205/gcc/cp/call.c:3832
#4  0x00000000005c2609 in finish_call_expr (fn=0x2aaaac6a6880,
args=0x7fffffffddf0, disallow_virtual=0 '\000', koenig_p=0 '\000', complain=3)
    at ../../gcc-4.6-20110205/gcc/cp/semantics.c:2133
#5  0x00000000004eeaa8 in tsubst_copy_and_build (t=0x2aaaac3f4730, args=<value
optimized out>, complain=<value optimized out>, in_decl=<value optimized out>,
    function_p=<value optimized out>, integral_constant_expression_p=<value
optimized out>) at ../../gcc-4.6-20110205/gcc/cp/pt.c:12917
#6  0x00000000004e2469 in tsubst_expr (t=0x2aaaac3f4730, args=0x2aaaac6a7d90,
complain=3, in_decl=0x2aaaac41b450, integral_constant_expression_p=0 '\000')
    at ../../gcc-4.6-20110205/gcc/cp/pt.c:12378
#7  0x00000000004e3912 in tsubst_expr (t=0x2aaaaba51540, args=0x2aaaac6a7d90,
complain=3, in_decl=0x2aaaac41b450, integral_constant_expression_p=0 '\000')
    at ../../gcc-4.6-20110205/gcc/cp/pt.c:12081
#8  0x00000000004e2b35 in tsubst_expr (t=<value optimized out>,
args=0x2aaaac6a7d90, complain=3, in_decl=0x2aaaac41b450,
integral_constant_expression_p=0 '\000')
    at ../../gcc-4.6-20110205/gcc/cp/pt.c:11940
#9  0x00000000004e395b in tsubst_expr (t=<value optimized out>,
args=0x2aaaac6a7d90, complain=3, in_decl=0x2aaaac41b450,
integral_constant_expression_p=0 '\000')
    at ../../gcc-4.6-20110205/gcc/cp/pt.c:12083
#10 0x00000000004e2519 in tsubst_expr (t=0x2aaaac411700, args=0x2aaaac6a7d90,
complain=3, in_decl=0x2aaaac41b450, integral_constant_expression_p=0 '\000')
    at ../../gcc-4.6-20110205/gcc/cp/pt.c:12119
#11 0x000000000050f572 in instantiate_decl (d=0x2aaaac6a5500, defer_ok=<value
optimized out>, expl_inst_class_mem_p=0 '\000')
    at ../../gcc-4.6-20110205/gcc/cp/pt.c:17377
#12 0x0000000000516a24 in instantiate_pending_templates (retries=<value
optimized out>) at ../../gcc-4.6-20110205/gcc/cp/pt.c:17474
#13 0x00000000005450a2 in cp_write_global_declarations () at
../../gcc-4.6-20110205/gcc/cp/decl2.c:3682
#14 0x00000000009230f6 in compile_file (argc=16, argv=0x7fffffffe528) at
../../gcc-4.6-20110205/gcc/toplev.c:591
#15 do_compile (argc=16, argv=0x7fffffffe528) at
../../gcc-4.6-20110205/gcc/toplev.c:1900
#16 toplev_main (argc=16, argv=0x7fffffffe528) at
../../gcc-4.6-20110205/gcc/toplev.c:1963
#17 0x000000384821d974 in __libc_start_main () from /lib64/libc.so.6
#18 0x000000000048a779 in _start ()


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
                   ` (2 preceding siblings ...)
  2011-02-11 19:02 ` redi at gcc dot gnu.org
@ 2011-02-11 19:07 ` froydnj at codesourcery dot com
  2011-02-13 17:44 ` jsm28 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: froydnj at codesourcery dot com @ 2011-02-11 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from froydnj at codesourcery dot com <froydnj at codesourcery dot com> 2011-02-11 19:06:39 UTC ---
FWIW, it was working a week ago.


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
                   ` (3 preceding siblings ...)
  2011-02-11 19:07 ` froydnj at codesourcery dot com
@ 2011-02-13 17:44 ` jsm28 at gcc dot gnu.org
  2011-02-13 18:11 ` jsm28 at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2011-02-13 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
                   ` (4 preceding siblings ...)
  2011-02-13 17:44 ` jsm28 at gcc dot gnu.org
@ 2011-02-13 18:11 ` jsm28 at gcc dot gnu.org
  2011-02-20 23:18 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2011-02-13 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
                   ` (5 preceding siblings ...)
  2011-02-13 18:11 ` jsm28 at gcc dot gnu.org
@ 2011-02-20 23:18 ` jason at gcc dot gnu.org
  2011-02-20 23:20 ` jason at gcc dot gnu.org
  2011-02-20 23:26 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-02-20 23:18 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-02-20 23:07:27 UTC ---
Got it.


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
                   ` (6 preceding siblings ...)
  2011-02-20 23:18 ` jason at gcc dot gnu.org
@ 2011-02-20 23:20 ` jason at gcc dot gnu.org
  2011-02-20 23:26 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-02-20 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-02-20 23:18:16 UTC ---
Author: jason
Date: Sun Feb 20 23:18:11 2011
New Revision: 170349

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170349
Log:
    PR c++/47703
    * error.c (location_of): Handle non-tagged types.

Added:
    trunk/gcc/testsuite/g++.dg/overload/conv-op1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/47703] [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function
  2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
                   ` (7 preceding siblings ...)
  2011-02-20 23:20 ` jason at gcc dot gnu.org
@ 2011-02-20 23:26 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-02-20 23:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-02-20 23:19:57 UTC ---
Fixed.


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

end of thread, other threads:[~2011-02-20 23:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-11 18:11 [Bug c++/47703] New: [4.6 Regression] [C++0x] ICE: std::sort chokes on simple lambda function erik.sandbraaten at gmail dot com
2011-02-11 18:56 ` [Bug c++/47703] " redi at gcc dot gnu.org
2011-02-11 19:00 ` redi at gcc dot gnu.org
2011-02-11 19:02 ` redi at gcc dot gnu.org
2011-02-11 19:07 ` froydnj at codesourcery dot com
2011-02-13 17:44 ` jsm28 at gcc dot gnu.org
2011-02-13 18:11 ` jsm28 at gcc dot gnu.org
2011-02-20 23:18 ` jason at gcc dot gnu.org
2011-02-20 23:20 ` jason at gcc dot gnu.org
2011-02-20 23:26 ` jason 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).