[clang-tools-extra] [clang-tidy] Avoid replacing match_results length() with empty() (PR #234905)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 08:49:22 PDT 2026


================
@@ -0,0 +1,23 @@
+#ifndef TEST_REGEX
+#define TEST_REGEX
+
+namespace std {
+
+template <typename BidirectionalIterator>
+class match_results {
+public:
+  using size_type = unsigned long;
+
+  size_type length(size_type sub = 0) const;
----------------
MitraGulla wrote:

I didn't checked the exact return type earlier, i have now updated the declaration in the mock header from

`size_type length(size_type sub = 0) const;`  to

`difference_type length(size_type sub = 0) const;`

to match the standard definition.

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


More information about the cfe-commits mailing list