[patch] Fix PR52822 (stable_partition move-assigns object to itself) in trunk, 4.7, and 4.6

Paolo Carlini paolo.carlini@oracle.com
Tue Apr 10 18:23:00 GMT 2012


Hi,
>> For the mainline/4.7 version, you want to cast __pred to bool:
>> !bool(__pred(*__first)). Also, isn't clear to me why you have __local_len in
>> __find_if_not_n instead of just working on __len (and in any case please
>> prefer just __local_len as condition instead of the redundant __local_len !=
>> 0; likewise in many other similar situations).
> I was micro-optimizing, since the compiler might think __len is
> modified in __pred if it doesn't inline enough. I've removed
> __local_len, casted pred results to bool, and avoided !=0.
>
>> Also, very minor nit, you will be touching the libstdc++-v3 Changelog thus
>> no libstdc++-v3 prefixes in the ChangeLog entry.
> Yep, done.
Great, patches are Ok and thanks a lot again for working on this. 
Please, keep an eye to any user code exercising the new bits in 
mainline/4_7-branch.

Thanks,
Paolo.



More information about the Gcc-patches mailing list