This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3 PATCH] PR libstdc++/78389


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.

Attachment: 78389_4.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]