This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC 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: Sun, 15 Jan 2017 19:22:03 +0200
- Subject: Re: [v3 PATCH] PR libstdc++/78389
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUYjjXW2MGuEaLRPHV87R7YB-PTYhSk7QnxzJUBdHS4nkA@mail.gmail.com> <CAPQZVxvKSeaboXFC=W722L+M9W1fMW2v7Q3dZnfjfTYsxJmNhQ@mail.gmail.com> <CAFk2RUbWSEE9+573SJGiCUGQTHfG+EoLF8sEhk7PAsf5dQ=+0A@mail.gmail.com> <CAFk2RUYTg4BJGFnCQWYMGkBK6+KKtLETKMBKp+bS1-OuR2W1OA@mail.gmail.com>
On 15 January 2017 at 19:07, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> On 15 January 2017 at 19:01, Ville Voutilainen
> <ville.voutilainen@gmail.com> wrote:
>> On 15 January 2017 at 18:42, Tim Song <t.canens.cpp@gmail.com> wrote:
>>> On rereading the patch today, the size calculation for merge() appears
>>> to be backwards. [__first2, __last2) consists of the nodes not
>>> transferred into *this, so the new size of __x should be __dist while
>>> this->size() should be incremented by (__orig_size - __dist).
>>
>> Ah, yes, I'm an idiot. Fixing...
>
> 2017-01-15 Ville Voutilainen <ville.voutilainen@gmail.com>
>
> PR libstdc++/78389
> Fix backwards size adjustments.
> * include/bits/list.tcc (merge(list&&)):
> Fix backwards size adjustments.
> (merge(list&&, _StrictWeakOrdering)): Likewise.
> * testsuite/23_containers/list/operations/78389.cc: Add
> better test for the sizes.
Hmm, and yeah, your test uses a different throw-after number, so I
should change the tests to do the same. :)