<div dir="ltr">Would this break (what I assume is) correct code doing things like:<br><br>std::find(sregex_iterator(s.begin(), s.end(), regex("meow")), end, "foo");<br><br>?</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 4:21 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Users can write<br>
        for(sregex_iterator i(s.begin(), s.end(), regex("meow")), end; i != end; ++i)<br>
<br>
binding a temporary regex to const regex& and storing a pointer to it.<br>
This will compile silently, triggering undefined behavior at runtime.<br>
<br>
Fixing this involves defining constructors for the various regex iterator types from rvalue regexes, and then marking them as “deleted”.<br>
And tests.<br>
<br>
-- Marshall<br>
<br>
Marshall Clow     Idio Software   <mailto:<a href="mailto:mclow.lists@gmail.com">mclow.lists@gmail.com</a>><br>
<br>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br>
        -- Yu Suzuki<br>
<br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">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/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>