From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28056 invoked by alias); 30 Jan 2015 11:06:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27965 invoked by uid 48); 30 Jan 2015 11:05:55 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64865] std::allocator::construct/destroy not called for specialization of std::allocator Date: Fri, 30 Jan 2015 11:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03503.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64865 --- Comment #3 from Jonathan Wakely --- (In reply to TC from comment #2) > Since the allocator_type member must be the Alloc template argument provided > by the user and not any rebound types, though, N.B. libstdc++ supports std::vector> and so always rebinds the _Alloc parameter to get an allocator for the value_type. That doesn't change your argument though, because it will rebind it to allocator and that's the type that's specialized. > it seems to me that it is in > fact guaranteed that their versions of construct() and destroy() will be > called, as the paragraph you cite requires the use of > allocator_traits::construct and > allocator_traits::destroy. That's a defect, see http://cplusplus.github.io/LWG/lwg-active.html#2218 That defect is a problem for node-based containers, but in principle any container should be able to use allocator_traits::rebind_traits::construct() to construct the elements, in which case your allocator specialization is not used.