<br><br><div>On Wed Jan 08 2014 at 10:47:59 AM, Marshall Clow <<a href="mailto:mclow.lists@gmail.com">mclow.lists@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>
<br>
While I was fixing that, I added a drive-by fix in the assignment operator or regex_token_iterator as well:<br>
<br>
         if (__x.__result_ == &__x.__suffix_)<br>
-            __result_ == &__suffix_;<br>
+            __result_ = &__suffix_;<br>
<br>
i.e, there was a comparison instead of an assignment :-(<br></blockquote><div><br></div><div>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))</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Added tests to make sure that the iterators were independent for both regex_iterator and regex_token_iterator.<br>
<br>
— Marshall<br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</blockquote>