[PATCH] PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad OR-result

David Blaikie dblaikie at gmail.com
Wed Jun 18 09:17:08 PDT 2014


On second thoughts - this is actually testable, of course. Could you
write a unit test for this?

(I realize that once the op bool is fixed, the unit test would only
fail to compile if the const was missing - but it seems like a
reasonable test to have, ensuring that comparisons of const objects
does the right thing. Indeed if there's already a test for op==/op!=,
it shuold just be modified to use const operands)

On Wed, Jun 18, 2014 at 9:14 AM, David Blaikie <dblaikie at gmail.com> wrote:
> I suspect the primary bug here is that operator bool should be
> explicit. Could you send a review for that too? (& verify that it
> would've made the example given in PR10140 fail to compile, instead of
> comparing booleans? (without the const patch applied))
>
> In any case, I'll sign off on this change to add "const" - please go
> ahead and commit.
>
> http://reviews.llvm.org/D4194
>
>



More information about the llvm-commits mailing list