This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/65470] regex_search corrupts matches when haystack is destroyed
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Mar 2015 18:56:09 +0000
- Subject: [Bug libstdc++/65470] regex_search corrupts matches when haystack is destroyed
- Auto-submitted: auto-generated
- References: <bug-65470-4 at http dot gcc dot gnu dot org/bugzilla/>
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.