gcc/libstdc++-v3/include
Jonathan Wakely f5a2d78072 libstdc++: Reduce use of debug containers in <regex>
The std::regex code uses std::map and std::vector, which means that when
_GLIBCXX_DEBUG is defined it uses the debug versions of those
containers. That no longer compiles, because I changed <regex> to
include <bits/stl_map.h> and <bits/stl_vector.h> instead of <map> and
<vector>, so the debug versions aren't defined, and std::map doesn't
compile. There is also a use of std::stack, which defaults to std::deque
which is the debug deque when _GLIBCXX_DEBUG is defined.

Using std::map, std::vector, and std::deque is probably a mistake, and
we should qualify them with _GLIBCXX_STD_C instead so that the debug
versions aren't used. We do not need the overhead of checking our own
uses of those containers, which should be correct anyway. The exception
is the vector base class of std::match_results, which exposes iterators
to users, so can benefit from debug mode checks for its iterators. For
other accesses to the vector elements, match_results already does its
own checks, so can access the _GLIBCXX_STD_C::vector base class
directly.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/regex.h (basic_regex::transform_primary): Use
	_GLIBCXX_STD_C::vector for local variable.
	* include/bits/regex.tcc (__regex_algo_impl): Use reference to
	_GLIBCXX_STD_C::vector base class of match_results.
	* include/bits/regex_automaton.tcc (_StateSeq:_M_clone): Use
	_GLIBCXX_STD_C::map and _GLIBCXX_STD_C::deque for local
	variables.
	* include/bits/regex_compiler.h (_BracketMatcher): Use
	_GLIBCXX_STD_C::vector for data members.
	* include/bits/regex_executor.h (_Executor): Likewise.
	* include/std/regex [_GLIBCXX_DEBUG]: Include <debug/vector>.
2021-08-09 20:46:56 +01:00
..
backward
bits libstdc++: Reduce use of debug containers in <regex> 2021-08-09 20:46:56 +01:00
c
c_compatibility
c_global
c_std
debug libstdc++: [_GLIBCXX_DEBUG] Avoid allocator operator== when always equal 2021-08-09 20:44:58 +02:00
decimal
experimental libstdc++: Simplify std::optional::value() 2021-07-27 21:36:01 +01:00
ext libstdc++: Use __builtin_operator_new when available [PR94295] 2021-07-22 14:38:34 +01:00
parallel
precompiled
pstl
std libstdc++: Reduce use of debug containers in <regex> 2021-08-09 20:46:56 +01:00
tr1
tr2
Makefile.am libstdc++: Move COW string definitions to separate header 2021-07-27 12:04:18 +01:00
Makefile.in libstdc++: Move COW string definitions to separate header 2021-07-27 12:04:18 +01:00