The example program below will exhibit the problem when compiled with -std=c++0x or gnu++0x flag. The fix appears to be trivial, but requires a change to <ext/algorithm> header.
Example program: #include <iostream> #include <ext/rope> using namespace std; int main(int argc, char **argv) { __gnu_cxx::crope line("test-test-test"); cout << line.c_str() << endl; return 0; } Compilation error message: In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/ropeimpl.h:48, from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/rope:2956, from testrope.cpp:2: /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm: In function ‘std::pair<_InputIter, _ForwardIter> __gnu_cxx::copy_n(_InputIterator, _Size, _OutputIterator) [with _InputIterator = char*, _Size = long unsigned int, _OutputIterator = char*]’: /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/ropeimpl.h:1090: instantiated from ‘static _CharT* __gnu_cxx::rope<_CharT, _Alloc>::_S_flatten(__gnu_cxx::_Rope_RopeRep<_CharT, _Alloc>*, _CharT*) [with _CharT = char, _Alloc = std::allocator<char>]’ /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/ropeimpl.h:1621: instantiated from ‘const _CharT* __gnu_cxx::rope<_CharT, _Alloc>::c_str() const [with _CharT = char, _Alloc = std::allocator<char>]’ testrope.cpp:10: instantiated from here /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm:127: error: call of overloaded ‘__copy_n(char*&, long unsigned int&, char*&, std::random_access_iterator_tag)’ is ambiguous /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm:78: note: candidates are: std::pair<_InputIter, _ForwardIter> __gnu_cxx::__copy_n(_InputIterator, _Size, _OutputIterator, std::input_iterator_tag) [with _InputIterator = char*, _Size = long unsigned int, _OutputIterator = char*] /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm:93: note: std::pair<_InputIter, _ForwardIter> __gnu_cxx::__copy_n(_RAIterator, _Size, _OutputIterator, std::random_access_iterator_tag) [with _RAIterator = char*, _Size = long unsigned int, _OutputIterator = char*] /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_algo.h:1003: note: _OutputIterator std::__copy_n(_RandomAccessIterator, _Size, _OutputIterator, std::random_access_iterator_tag) [with _RandomAccessIterator = char*, _Size = long unsigned int, _OutputIterator = char*] /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_algo.h:988: note: _OutputIterator std::__copy_n(_InputIterator, _Size, _OutputIterator, std::input_iterator_tag) [with _InputIterator = char*, _Size = long unsigned int, _OutputIterator = char*] -- Summary: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header 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=44708