[Bug libstdc++/65470] regex_search corrupts matches when haystack is destroyed
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 19 19:32:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65470
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The behaviour is intended and clearly documented by the specification of the
Standard Library: match_results, such as cmath, just hold weak references (via
its sub_match elements) to the original search sequence, so (2) is definitively
not an option. This doesn't look like a defect to me, this is just a
misunderstanding of the user about the semantics of std::regex_search.
More information about the Gcc-bugs
mailing list