gcc/libstdc++-v3/testsuite/28_regex
Jonathan Wakely f38cd3bdb4 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.
2021-09-29 13:48:19 +01:00
..
algorithms libstdc++: Implement std::regex_constants::multiline (LWG 2503) 2021-09-29 13:48:19 +01:00
basic_regex libstdc++: Check for invalid syntax_option_type values in <regex> 2021-09-29 13:48:15 +01:00
constants Update copyright years. 2021-01-04 10:26:59 +01:00
headers/regex Update copyright years. 2021-01-04 10:26:59 +01:00
iterators Update copyright years. 2021-01-04 10:26:59 +01:00
match_results libstdc++: Remove redundant -std=gnu++17 option from PMR tests 2021-05-10 16:22:53 +01:00
regex_error Update copyright years. 2021-01-04 10:26:59 +01:00
requirements Update copyright years. 2021-01-04 10:26:59 +01:00
sub_match Update copyright years. 2021-01-04 10:26:59 +01:00
traits libstdc++: Reduce header dependencies in <regex> 2021-08-03 15:24:52 +01:00
init-list.cc Update copyright years. 2021-01-04 10:26:59 +01:00
range_access.cc libstdc++: Add [[nodiscard]] to iterators and related utilities 2021-08-04 12:54:28 +01:00
regression.cc Update copyright years. 2021-01-04 10:26:59 +01:00
simple_c++11.cc Update copyright years. 2021-01-04 10:26:59 +01:00