[LLVMbugs] [Bug 18404] New: Bug in regex_token_iterator::operator++(int) implementation
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Jan 6 19:18:36 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18404
Bug ID: 18404
Summary: Bug in regex_token_iterator::operator++(int)
implementation
Product: libc++
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: hhinnant at apple.com
Reporter: zhangmingze at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
The bug is explained in
http://stackoverflow.com/questions/20323648/regex-token-iterator-it-bug/20963149#20963149
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140107/9938ec57/attachment.html>
More information about the llvm-bugs
mailing list