PATCH for PR18404 - Bug in regex_token_iterator::operator++(int) implementation
dblaikie at gmail.com
dblaikie at gmail.com
Wed Jan 8 12:00:24 PST 2014
On Wed Jan 08 2014 at 10:47:59 AM, Marshall Clow <mclow.lists at gmail.com>
wrote:
> It’s not actually a bug in operator++(int), but rather in the copy
> constructor and the assignment operator, which causes copied
> regex_token_iterators to be coupled.
>
> While I was fixing that, I added a drive-by fix in the assignment operator
> or regex_token_iterator as well:
>
> if (__x.__result_ == &__x.__suffix_)
> - __result_ == &__suffix_;
> + __result_ = &__suffix_;
>
> i.e, there was a comparison instead of an assignment :-(
>
Did Clang fail to diagnose this? Do you know why? (-Wunused-value should
catch things like this - assuming it's a builtin op==, not an overload
(though perhaps we could extend it to handle overloads... though that might
be risky))
>
> Added tests to make sure that the iterators were independent for both
> regex_iterator and regex_token_iterator.
>
> — Marshall
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140108/fa4bd638/attachment.html>
More information about the cfe-commits
mailing list