This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3 PATCH] Protect allocator-overloads of tuple-from-tuple constructors from cases that would create dangling references.
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Paolo Carlini <paolo dot carlini at oracle dot com>, Jonathan Wakely <jwakely at redhat dot com>
- Date: Sun, 29 May 2016 17:42:07 +0300
- Subject: Re: [v3 PATCH] Protect allocator-overloads of tuple-from-tuple constructors from cases that would create dangling references.
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUb16DS52H5pCTaesJSnJyun__3OVQUyHaHxMmumd9zgFg at mail dot gmail dot com>
On 28 May 2016 at 21:25, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> The fix to avoid binding dangling references to temporaries for tuple's
> constructors that take tuples of different type didn't include the fix
> for allocator overloads. That was just lazy, and I should feel ashamed.
> This patch fixes it, and takes us one step further to pass libc++'s testsuite
> for tuple. The added _NonNestedTuple checks could actually be folded
> into the recently-added _TMCT alias, but I'll do that as a separate cleanup
> patch. For now, this should do as an easy and straightforward fix.
>
> Tested on Linux-x64.
>
> 2016-05-28 Ville Voutilainen <ville.voutilainen@gmail.com>
>
> Protect allocator-overloads of tuple-from-tuple constructors
> from cases that would create dangling references.
> * include/std/tuple (tuple(allocator_arg_t, const _Alloc&,
> const tuple<_UElements...>&), tuple(allocator_arg_t, const _Alloc&,
> tuple<_UElements...>&&)): Add a check for _NonNestedTuple.
> * testsuite/20_util/tuple/cons/nested_tuple_construct.cc: Adjust.
Since Jonathan is going to be out-of-reach for next week due to a
well-deserved holiday, would it be ok
if Paolo approves such patches?