public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kariya_mitsuru at hotmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified Date: Mon, 17 Nov 2014 17:49:00 -0000 [thread overview] Message-ID: <bug-63920-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63920 Bug ID: 63920 Summary: Any regular expression should not match an empty sequence if match_not_null is specified Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: kariya_mitsuru at hotmail dot com Created attachment 34005 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34005&action=edit gcc -v The sample code below should output "not match" but it outputs "match:1, 0" if it is compiled by gcc 5.0. ==================================================================================================== #include <iostream> #include <regex> int main() { std::cmatch m; auto result = std::regex_search("a", m, std::regex("b*"), std::regex_constants::match_not_null); if (result) { std::cout << "match:" << m.position() << ", " << m.length() << std::endl; } else { std::cout << "not match" << std::endl; } } ==================================================================================================== cf. http://melpon.org/wandbox/permlink/pTz5CBMMP4a6BU7f According to C++11 standard 28.5.2[re.matchflag]/Table 139, "The expression shall not match an empty sequence." if match_not_null is specified. Note that the sample code of the Boost.regex version outputs "not match". cf. http://melpon.org/wandbox/permlink/mfFqERCbt6qFf8HC
next reply other threads:[~2014-11-17 17:49 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-11-17 17:49 kariya_mitsuru at hotmail dot com [this message] 2014-11-18 18:57 ` [Bug libstdc++/63920] " kariya_mitsuru at hotmail dot com 2014-11-25 5:43 ` timshen at gcc dot gnu.org 2015-02-06 7:04 ` timshen at gcc dot gnu.org 2023-07-20 11:35 ` 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-63920-4@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).