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

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