This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__gnu_cxx::rope: __uninitialized_fill_n_a error


Hi,

With libstdc++ 4.7.1, the following basic C++ code doesn't build. I'm
not sure, but it seems I haven't forget to include some header.

#include <ext/rope>
#include <ext/pool_allocator.h>

typedef __gnu_cxx::rope<char, __gnu_cxx::__pool_alloc<char> > _rope_t;

int main()
{
  _rope_t r(1000, 'a');

  // this code doesn't build too
  // _rope_t r("f00");
  // r.append(1000, 'a');

  return 0;
}

It works fine with the following patch in ropeimpl.h:

*** ropeimpl_old.h      2012-09-30 14:28:33.276057217 +0200
--- ropeimpl.h  2012-09-30 14:28:25.684057035 +0200
*************** _GLIBCXX_BEGIN_NAMESPACE_VERSION
*** 59,64 ****
--- 59,65 ----
    using std::__throw_length_error;
    using std::_Destroy;
    using std::uninitialized_fill_n;
+   using std::__uninitialized_fill_n_a;

    // Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
    // if necessary.  Assumes _M_path_end[leaf_index] and leaf_pos are correct.


Here is the complete error :

$ g++ -o test test.cpp
In file included from /usr/include/c++/4.7/ext/rope:2975:0,
                 from test.cpp:1:
/usr/include/c++/4.7/ext/ropeimpl.h: In instantiation of
'__gnu_cxx::rope<_CharT, _Alloc>::rope(std::size_t, _CharT, const
allocator_type&) [with _CharT = char; _Alloc =
__gnu_cxx::__pool_alloc<char>; std::size_t = long unsigned int;
__gnu_cxx::rope<_CharT, _Alloc>::allocator_type =
__gnu_cxx::__pool_alloc<char>]':
test.cpp:7:22:   required from here
/usr/include/c++/4.7/ext/ropeimpl.h:1550:4: error:
'__uninitialized_fill_n_a' was not declared in this scope
/usr/include/c++/4.7/ext/ropeimpl.h:1550:4: note: suggested alternative:
In file included from /usr/include/c++/4.7/ext/rope:52:0,
                 from test.cpp:1:
/usr/include/c++/4.7/bits/stl_uninitialized.h:334:5: note:
'std::__uninitialized_fill_n_a'
In file included from /usr/include/c++/4.7/ext/rope:2975:0,
                 from test.cpp:1:
/usr/include/c++/4.7/ext/ropeimpl.h:1570:4: error:
'__uninitialized_fill_n_a' was not declared in this scope
/usr/include/c++/4.7/ext/ropeimpl.h:1570:4: note: suggested alternative:
In file included from /usr/include/c++/4.7/ext/rope:52:0,
                 from test.cpp:1:
/usr/include/c++/4.7/bits/stl_uninitialized.h:334:5: note:
'std::__uninitialized_fill_n_a'


Regards,

David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]