[Bug libstdc++/42352] -std=c++0x reference binding problem

rwgk at yahoo dot com gcc-bugzilla@gcc.gnu.org
Mon Dec 14 06:05:00 GMT 2009



------- Comment #12 from rwgk at yahoo dot com  2009-12-14 06:05 -------
(In reply to comment #10)
> What do you mean by "of this type"? As I tried already to explain, until the
> ISO C++ Committee resolves DR 1133 we cannot touch list::merge and
> list::splice. 

Sorry, I wasn't looking carefully enough. The remaining errors are indeed
different. Reduced below.
If I comment out all .splice() in our code everything else compiles.
The DR details are over my head, I'm afraid. Does "cannot touch" mean we are
stuck with a broken list.splice() and .merge() for now, until the standards
committee has made changes?

#include <list>
void work()
{
 std::list<int> l, m;
 l.splice(l.end(), m);
}

% g++ -c -std=c++0x ~/gcc_bugs/list_splice_bind.cpp
/net/cci/rwgk/gcc_bugs/list_splice_bind.cpp: In function 'void work()':
/net/cci/rwgk/gcc_bugs/list_splice_bind.cpp:6:21: error: cannot bind
'std::list<int>' lvalue to 'std::list<int>&&'
/net/cci-filer1/vol1/tmp/rwgk/gcc_trunk_155182_fc12_x86_64/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/bits/stl_list.h:1154:7:
error:   initializing argument 2 of 'void std::list<_Tp,
_Alloc>::splice(std::list<_Tp, _Alloc>::iterator, std::list<_Tp, _Alloc>&&)
[with _Tp = int, _Alloc = std::allocator<int>, std::list<_Tp, _Alloc>::iterator
= std::_List_iterator<int>, std::list<_Tp, _Alloc> = std::list<int>]'


-- 


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



More information about the Gcc-bugs mailing list