<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Bug in regex_token_iterator::operator++(int) implementation"
href="http://llvm.org/bugs/show_bug.cgi?id=18404">18404</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Bug in regex_token_iterator::operator++(int) implementation
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>hhinnant@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhangmingze@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The bug is explained in
<a href="http://stackoverflow.com/questions/20323648/regex-token-iterator-it-bug/20963149#20963149">http://stackoverflow.com/questions/20323648/regex-token-iterator-it-bug/20963149#20963149</a>
regex_token_iterator operator++(int)
{
regex_token_iterator __t(*this);
std::cout << "test---" << *__t << "---test" << endl;
++(*this);
std::cout << "test---" << *__t << "---test" << endl;
return __t;
}
you find that the value of *__t changed after ++(*this) !
Further digging into you will find that,
*__t is actually implemented by returning internal value_type pointer _result,
while _result actually points to &_position->prefix(), which is the address of
match_results' _prefix object, the address of this object never changed, but
the content of it changed.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>