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: [email protected]
Reporter: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs