This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/65470] regex_search corrupts matches when haystack is destroyed


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]