public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/14245] New: problem with user-defined allocators in std::basic_string
@ 2004-02-22 19:49 cbotev at yahoo dot com
  2004-02-25  9:49 ` [Bug libstdc++/14245] " pcarlini at suse dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: cbotev at yahoo dot com @ 2004-02-22 19:49 UTC (permalink / raw)
  To: gcc-bugs

GCC/libstdc++ 3.3.3-0pre3
Debian Linux Testing("Sarge")

It looks like the STL implementation of libstdc++ 3.3.3.0pre3 assumes that the 
user-defined allocators (at least for basic_string) should be initialized using
the default constructor. 

In particular, the copy constructor for the string representation (struct _Rep)
for basic_string uses the default constructor of the
allocator(basic_string.tcc:192). I think this is wrong: the allocator may need
additional info for proper initialization. It is also unnecessary. Simply using
the copy constructor should be enough.

I think the new line should look something like:

   : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
__str.get_allocator()),


Cheers,
Chavdar

-- 
           Summary: problem with user-defined allocators in
                    std::basic_string
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cbotev at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-06-07 22:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-22 19:49 [Bug libstdc++/14245] New: problem with user-defined allocators in std::basic_string cbotev at yahoo dot com
2004-02-25  9:49 ` [Bug libstdc++/14245] " pcarlini at suse dot de
2004-02-25 14:01 ` cbotev at yahoo dot com
2004-02-25 14:23 ` pcarlini at suse dot de
2004-02-25 15:43 ` pcarlini at suse dot de
2004-02-25 15:53 ` pcarlini at suse dot de
2004-03-28 16:27 ` cvs-commit at gcc dot gnu dot org
2004-03-28 16:28 ` pcarlini at suse dot de
2004-04-21 10:58 ` [Bug libstdc++/14245] [3.4 only] " cvs-commit at gcc dot gnu dot org
2004-04-21 11:14 ` pcarlini at suse dot de
2004-06-07 22:24 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).