This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/44963] New: Ambiguous function overload using __gnu_cxx::crope with std::back_inserter in c++0x mode
- From: "oakad at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2010 10:28:19 -0000
- Subject: [Bug libstdc++/44963] New: Ambiguous function overload using __gnu_cxx::crope with std::back_inserter in c++0x mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The example program below will exhibit the problem when compiled with
-std=c++0x or gnu++0x flag. The problem is particularly unfortunate, as rope is
designed for use with back_inserter style constructs.
Example program:
#include <iostream>
#include <ext/rope>
using namespace std;
int main(int argc, char **argv)
{
__gnu_cxx::crope line("test");
auto ii(back_inserter(line));
*ii++ = 'm';
*ii++ = 'e';
cout << line << endl;
return 0;
}
Compilation error message:
testrope1.cpp: In function ‘int main(int, char**)’:
testrope1.cpp:11: error: ambiguous overload for ‘operator=’ in
‘ii.std::back_insert_iterator<_Container>::operator++ [with _Container =
__gnu_cxx::rope<char, std::allocator<char>
>](0).std::back_insert_iterator<_Container>::operator* [with _Container =
__gnu_cxx::rope<char, std::allocator<char> >]() = 'm'’
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_iterator.h:415:
note: candidates are: std::back_insert_iterator<_Container>&
std::back_insert_iterator<_Container>::operator=(typename
_Container::const_reference) [with _Container = __gnu_cxx::rope<char,
std::allocator<char> >]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_iterator.h:423:
note: std::back_insert_iterator<_Container>&
std::back_insert_iterator<_Container>::operator=(typename
_Container::value_type&&) [with _Container = __gnu_cxx::rope<char,
std::allocator<char> >]
testrope1.cpp:12: error: ambiguous overload for ‘operator=’ in
‘ii.std::back_insert_iterator<_Container>::operator++ [with _Container =
__gnu_cxx::rope<char, std::allocator<char>
>](0).std::back_insert_iterator<_Container>::operator* [with _Container =
__gnu_cxx::rope<char, std::allocator<char> >]() = 'e'’
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_iterator.h:415:
note: candidates are: std::back_insert_iterator<_Container>&
std::back_insert_iterator<_Container>::operator=(typename
_Container::const_reference) [with _Container = __gnu_cxx::rope<char,
std::allocator<char> >]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_iterator.h:423:
note: std::back_insert_iterator<_Container>&
std::back_insert_iterator<_Container>::operator=(typename
_Container::value_type&&) [with _Container = __gnu_cxx::rope<char,
std::allocator<char> >]
--
Summary: Ambiguous function overload using __gnu_cxx::crope with
std::back_inserter in c++0x mode
Product: gcc
Version: 4.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: oakad at yahoo dot com
GCC build triplet: x86_64-pc-linux-gnu
GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44963