https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97876
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:cbbc28706164873d0323d1a6c7988be3f4d971c9 commit r10-9057-gcbbc28706164873d0323d1a6c7988be3f4d971c9 Author: Jonathan Wakely <jwak...@redhat.com> Date: Fri Nov 20 11:30:33 2020 +0000 libstdc++: Remove <memory_resource> dependency from <regex> [PR 92546] Unlike the other headers that declare alias templates in namespace pmr, <regex> includes <memory_resource>. That was done because the pmr::string::const_iterator typedef requires pmr::string to be complete, which requires pmr::polymorphic_allocator<char> to be complete. By using __normal_iterator<const char*, pmr::string> instead of the const_iterator typedef we can avoid the completeness requirement. This makes <regex> smaller, by not requiring <memory_resource> and its <shared_mutex> dependency, which depends on <chrono>. Backporting this will also help with PR 97876, where <stop_token> ends up being needed by <regex> via <memory_resource>. libstdc++-v3/ChangeLog: PR libstdc++/92546 * include/std/regex (pmr::smatch, pmr::wsmatch): Declare using underlying __normal_iterator type, not nested typedef basic_string::const_iterator. (cherry picked from commit 640ebeb336050887cb57417b7568279c588088f0)