[libcxx-commits] [libcxx] [libc++] Remove obsolete locale-specific regex tests (PR #159590)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 18 07:58:10 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index 024738258..ef86db040 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -574,27 +574,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_match(s, m,
-                      std::regex("[a[=m=]z]", std::regex_constants::awk)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_match(s, m,
-                      std::regex("[a[=M=]z]", std::regex_constants::awk)));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_match(s, m, std::regex("[a[=m=]z]", std::regex_constants::awk)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::awk)));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1239,27 +1237,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]",
-                                                 std::regex_constants::awk)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]",
-                                                 std::regex_constants::awk)));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]", std::regex_constants::awk)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]", std::regex_constants::awk)));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
index fd91866b9..c0433789b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
@@ -576,27 +576,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_match(s, m, std::regex("[a[=m=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_match(s, m, std::regex("[a[=M=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_match(s, m, std::regex("[a[=m=]z]", std::regex_constants::basic)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::basic)));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1227,27 +1225,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]", std::regex_constants::basic)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]", std::regex_constants::basic)));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
index 799a36242..8e4755330 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
@@ -564,25 +564,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_match(s, m, std::regex("[a[=m=]z]")));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_match(s, m, std::regex("[a[=m=]z]")));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_match(s, m, std::regex("[a[=M=]z]")));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_match(s, m, std::regex("[a[=M=]z]")));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1248,25 +1248,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]")));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]")));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]")));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]")));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
index e800fa88d..862a976a9 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
@@ -591,27 +591,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_match(s, m, std::regex("[a[=m=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_match(s, m, std::regex("[a[=M=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_match(s, m, std::regex("[a[=m=]z]", std::regex_constants::extended)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::extended)));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1258,27 +1256,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]", std::regex_constants::extended)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]", std::regex_constants::extended)));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
index 904ba0661..5d0bcec15 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
@@ -646,27 +646,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_search(s, m, std::regex("[a[=m=]z]",
-                                                 std::regex_constants::awk)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_search(s, m, std::regex("[a[=M=]z]",
-                                                 std::regex_constants::awk)));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_search(s, m, std::regex("[a[=m=]z]", std::regex_constants::awk)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::awk)));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1401,27 +1399,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]",
-                                                 std::regex_constants::awk)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]",
-                                                 std::regex_constants::awk)));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]", std::regex_constants::awk)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]", std::regex_constants::awk)));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
index 74b4d6341..84e94d906 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
@@ -648,27 +648,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_search(s, m, std::regex("[a[=m=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_search(s, m, std::regex("[a[=M=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_search(s, m, std::regex("[a[=m=]z]", std::regex_constants::basic)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::basic)));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1389,27 +1387,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]",
-                                                 std::regex_constants::basic)));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]", std::regex_constants::basic)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]", std::regex_constants::basic)));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
index ee88d1138..f58730226 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
@@ -631,25 +631,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_search(s, m, std::regex("[a[=m=]z]")));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_search(s, m, std::regex("[a[=M=]z]")));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_search(s, m, std::regex("[a[=m=]z]")));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_search(s, m, std::regex("[a[=M=]z]")));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1393,25 +1393,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]")));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]")));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]")));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]")));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
index 73c37267e..39be41e4b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
@@ -664,27 +664,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(std::regex_search(s, m, std::regex("[a[=m=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::cmatch m;
-        const char s[] = "m";
-        assert(!std::regex_search(s, m, std::regex("[a[=M=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 0);
+      std::cmatch m;
+      const char s[] = "m";
+      assert(std::regex_search(s, m, std::regex("[a[=m=]z]", std::regex_constants::extended)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::cmatch m;
+      const char s[] = "m";
+      assert(!std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::extended)));
+      assert(m.size() == 0);
     }
     {
         std::cmatch m;
@@ -1421,27 +1419,25 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
     {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 1);
-        assert(!m.prefix().matched);
-        assert(m.prefix().first == s);
-        assert(m.prefix().second == m[0].first);
-        assert(!m.suffix().matched);
-        assert(m.suffix().first == m[0].second);
-        assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
-        assert(m.position(0) == 0);
-        assert(m.str(0) == s);
-    }
-    {
-        std::wcmatch m;
-        const wchar_t s[] = L"m";
-        assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]",
-                                                 std::regex_constants::extended)));
-        assert(m.size() == 0);
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(std::regex_search(s, m, std::wregex(L"[a[=m=]z]", std::regex_constants::extended)));
+      assert(m.size() == 1);
+      assert(!m.prefix().matched);
+      assert(m.prefix().first == s);
+      assert(m.prefix().second == m[0].first);
+      assert(!m.suffix().matched);
+      assert(m.suffix().first == m[0].second);
+      assert(m.suffix().second == m[0].second);
+      assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+      assert(m.position(0) == 0);
+      assert(m.str(0) == s);
+    }
+    {
+      std::wcmatch m;
+      const wchar_t s[] = L"m";
+      assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]", std::regex_constants::extended)));
+      assert(m.size() == 0);
     }
     {
         std::wcmatch m;

``````````

</details>


https://github.com/llvm/llvm-project/pull/159590


More information about the libcxx-commits mailing list