This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] Fix libstdc++/51626
On 19 December 2011 22:39, Jonathan Wakely wrote:
> We don't have allocator_traits in 4.6 so this patch adds a test for
> whether we can call allocator::construct(p) with a single argument and
> calls _Construct(p) if not.
>
> ? ? ? ?PR libstdc++/51626
> ? ? ? ?* include/bits/stl_uninitialized.h (_Construct_default_a): Define
> ? ? ? ?overloaded functions to conditionally use allocator::construct.
> ? ? ? ?(_Construct_default_a): Define to dispatch to appropriate
> ? ? ? ?_Construct_default_a_impl overload.
> ? ? ? ?(__uninitialized_default_a, __uninitialized_default_n_a): Use
> ? ? ? ?_Construct_default_a.
> ? ? ? ?* testsuite/20_util/allocator/51626.cc
>
> Tested x86_64-linux.
>
> I plan to check this in to the 4.6 branch unless anyone has a better
> suggestion for fixing the bug.
I checked it in, with a corrected ChangeLog and updated copyright year
in stl_uninitialized.h
PR libstdc++/51626
* include/bits/stl_uninitialized.h (_Construct_default_a_impl): Define
overloaded functions to conditionally use allocator::construct.
(_Construct_default_a): Define to dispatch to appropriate
_Construct_default_a_impl overload.
(__uninitialized_default_a, __uninitialized_default_n_a): Use
_Construct_default_a.
* testsuite/20_util/allocator/51626.cc: New.