From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3785 invoked by alias); 22 Feb 2004 19:49:52 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3769 invoked by uid 48); 22 Feb 2004 19:49:51 -0000 Date: Sun, 22 Feb 2004 19:49:00 -0000 From: "cbotev at yahoo dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20040222194949.14245.cbotev@yahoo.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libstdc++/14245] New: problem with user-defined allocators in std::basic_string X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg02114.txt.bz2 List-Id: 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