[libcxx-commits] [libcxx] [libc++][regex] Fix #51028 throw exception in the case of wrong range (PR #148231)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 11 05:20:21 PDT 2025


================
@@ -2100,7 +2100,7 @@ public:
       __ranges_.push_back(
           std::make_pair(__traits_.transform(__b.begin(), __b.end()), __traits_.transform(__e.begin(), __e.end())));
     } else {
-      if (__b.size() != 1 || __e.size() != 1)
+      if (__b.size() != 1 || __e.size() != 1 || __b[0] > __e[0])
----------------
frederick-vs-ja wrote:

I think we should avoid modifying frozen C++03 headers. Comment `// XFAIL: FROZEN-CXX03-HEADERS-FIXME` should be added to `bad_range.pass.cpp` instead.

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


More information about the libcxx-commits mailing list