This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3 PATCH] PR libstdc++/78389
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: Tim Song <t dot canens dot cpp at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 13 Jan 2017 10:29:27 +0200
- Subject: Re: [v3 PATCH] PR libstdc++/78389
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUYmeFv5M4TX4_GuT71AVHaYLD=iXG7mzb+rYa+khoL-Vg@mail.gmail.com> <CAPQZVxtcQBh=WhioT_VNeY-heLBFyNGOhyt8WqtMnrbKPNzBBA@mail.gmail.com> <CAFk2RUZs3nB0HpWDaoiXK5Skq-8ima-ZAKCyXqfeEvqu_O6J0g@mail.gmail.com> <CAPQZVxsD-cF-XSTg6YDSnz+=hrT=EYv6UTAH8+AAdVk5CSC4xg@mail.gmail.com> <CAFk2RUYs6B5qizVp2C=LG=D8qEmuZtF9eMbtqhwBfCMyf_fcpw@mail.gmail.com> <CAFk2RUaBwFD8ao3nfkrvfbo7aXmd1gKQf3T88BNQM6tRbov=PQ@mail.gmail.com> <CAPQZVxvamQdpYDCdwrgrp+XE+vtnwB4ziV54-VOmCQDpiwE_Rw@mail.gmail.com> <CAFk2RUZ7RKKETKv-+aE6aSQ6p3YHeNC=FirmQDDY_d5OYAQM2w@mail.gmail.com> <CAFk2RUZCr_QEd_SkOb=tpduN38+RWmpbNyydOWx755vQn65nPg@mail.gmail.com>
On 13 January 2017 at 10:27, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> On 13 January 2017 at 10:09, Ville Voutilainen
> <ville.voutilainen@gmail.com> wrote:
>>>> Ah, I think I see what you're saying. Just splice them back in any
>>>> order. Ok, I'll give that a spin.
>>>
>>> Right, list::sort doesn't promise strong exception safety, so
>>> "unsorting" is not needed.
>>>
>>> Also, shouldn't merge() rethrow the caught exception rather than swallow it?
>>
>> Ha, yes, well spotted. I'll cook up an improved patch.
>
> Thus:
>
> 2017-01-13 Ville Voutilainen <ville.voutilainen@gmail.com>
>
> PR libstdc++/78389
> * include/bits/list.tcc (merge(list&&)):
> Adjust list sizes if the comparator throws.
> (merge(list&&, _StrictWeakOrdering)): Likewise.
> (sort()): Splice elements back from the scratch buffers
> if the comparator throws.
> (sort(_StrictWeakOrdering)): Likewise.
> * testsuite/23_containers/list/operations/78389.cc: New.
..and yes, sigh, that patch has whitespace damage in it. I have
already fixed that, so that'll be corrected before
committing.