public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/102480] std::regex fails to match ^ when match_prev_avail is used Date: Thu, 07 Jul 2022 23:32:25 +0000 [thread overview] Message-ID: <bug-102480-4-NAtnRAbgfx@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102480-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102480 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:e61c16fd9ba89e7bc12284e524dcd8379c2bebfc commit r11-10120-ge61c16fd9ba89e7bc12284e524dcd8379c2bebfc Author: Jonathan Wakely <jwakely@redhat.com> Date: Wed Sep 29 13:48:19 2021 +0100 libstdc++: Implement std::regex_constants::multiline (LWG 2503) This implements LWG 2503, which allows ^ and $ to match line terminator characters, rather than only matching the beginning and end of the entire input. The multiline option is only valid for ECMAScript, but for other grammars we ignore it rather than throwing an exception. This is related to PR libstdc++/102480, which incorrectly said that ECMAscript should match the beginning of a line when match_prev_avail is used. I think that's only supposed to happen when multiline is used. The new regex_constants::multiline and basic_regex::multiline constants are not defined for strict -std=c++11 and -std=c++14 modes, but regex_constants::__multiline is always defined, so that the implementation can use it internally. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/bits/regex.h (basic_regex::multiline): Define constant for C++17. * include/bits/regex_constants.h (regex_constants::multiline): Define constant for C++17. (regex_constants::__multiline): Define duplicate constant for internal use in C++11 and C++14. * include/bits/regex_executor.h (_Executor::_M_match_multiline()): New member function. (_Executor::_M_is_line_terminator(_CharT)): New member function. (_Executor::_M_at_begin(), _Executor::_M_at_end()): Use new member functions to support multiline matches. * testsuite/28_regex/algorithms/regex_match/multiline.cc: New test. (cherry picked from commit f38cd3bdb4cd429a5f7082ea91793a59b37d47b9)
next prev parent reply other threads:[~2022-07-07 23:32 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-24 23:34 [Bug libstdc++/102480] New: " redi at gcc dot gnu.org 2021-09-24 23:34 ` [Bug libstdc++/102480] " redi at gcc dot gnu.org 2021-09-27 11:45 ` redi at gcc dot gnu.org 2021-09-29 12:49 ` cvs-commit at gcc dot gnu.org 2021-09-29 15:47 ` redi at gcc dot gnu.org 2022-07-07 23:32 ` cvs-commit at gcc dot gnu.org [this message] 2022-07-07 23:36 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-102480-4-NAtnRAbgfx@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).