public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified
@ 2014-11-17 17:49 kariya_mitsuru at hotmail dot com
2014-11-18 18:57 ` [Bug libstdc++/63920] " kariya_mitsuru at hotmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: kariya_mitsuru at hotmail dot com @ 2014-11-17 17:49 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/63920] Any regular expression should not match an empty sequence if match_not_null is specified
2014-11-17 17:49 [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified kariya_mitsuru at hotmail dot com
@ 2014-11-18 18:57 ` kariya_mitsuru at hotmail dot com
2014-11-25 5:43 ` timshen at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: kariya_mitsuru at hotmail dot com @ 2014-11-18 18:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63920
--- Comment #1 from Mitsuru Kariya <kariya_mitsuru at hotmail dot com> ---
Sorry, the last link was mistaken.
The right link is below.
http://melpon.org/wandbox/permlink/v1HhsIs8d2LrmUk9
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/63920] Any regular expression should not match an empty sequence if match_not_null is specified
2014-11-17 17:49 [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified kariya_mitsuru at hotmail dot com
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
3 siblings, 0 replies; 5+ messages in thread
From: timshen at gcc dot gnu.org @ 2014-11-25 5:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63920
--- Comment #2 from Tim Shen <timshen at gcc dot gnu.org> ---
Author: timshen
Date: Tue Nov 25 05:43:04 2014
New Revision: 218037
URL: https://gcc.gnu.org/viewcvs?rev=218037&root=gcc&view=rev
Log:
PR libstdc++/63920
* include/bits/regex_executor.h: Make _M_begin non const.
* include/bits/regex_executor.tcc (_Executor<>::_M_search): Increase
_M_begin in search algorithm, so that _M_begin is treated as
"current start position" for each search iteration.
* testsuite/28_regex/algorithms/regex_search/ecma/flags.cc: New
testcase.
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/regex_executor.h
trunk/libstdc++-v3/include/bits/regex_executor.tcc
trunk/libstdc++-v3/testsuite/28_regex/algorithms/regex_search/ecma/flags.cc
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/63920] Any regular expression should not match an empty sequence if match_not_null is specified
2014-11-17 17:49 [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified kariya_mitsuru at hotmail dot com
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
3 siblings, 0 replies; 5+ messages in thread
From: timshen at gcc dot gnu.org @ 2015-02-06 7:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63920
Tim Shen <timshen at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Tim Shen <timshen at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/63920] Any regular expression should not match an empty sequence if match_not_null is specified
2014-11-17 17:49 [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified kariya_mitsuru at hotmail dot com
` (2 preceding siblings ...)
2015-02-06 7:04 ` timshen at gcc dot gnu.org
@ 2023-07-20 11:35 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-20 11:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63920
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-20 11:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 17:49 [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified kariya_mitsuru at hotmail dot com
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
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).