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*]
Fixing momentarily, thanks.
Subject: Bug 44708 Author: paolo Date: Tue Jun 29 10:03:36 2010 New Revision: 161524 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161524 Log: 2010-06-29 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44708 * include/ext/algorithm (copy_n): Qualify __copy_n call with __gnu_cxx:: * testsuite/ext/rope/44708.cc: New. Added: trunk/libstdc++-v3/testsuite/ext/rope/44708.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/ext/algorithm
Subject: Bug 44708 Author: paolo Date: Tue Jun 29 10:04:01 2010 New Revision: 161525 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161525 Log: 2010-06-29 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44708 * include/ext/algorithm (copy_n): Qualify __copy_n call with __gnu_cxx:: * testsuite/ext/rope/44708.cc: New. Added: branches/gcc-4_5-branch/libstdc++-v3/testsuite/ext/rope/44708.cc Modified: branches/gcc-4_5-branch/libstdc++-v3/ChangeLog branches/gcc-4_5-branch/libstdc++-v3/include/ext/algorithm
Fixed.