aboutsummaryrefslogtreecommitdiff
path: root/libcxx/src
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-08-05 10:23:06 -0500
committerGitHub <noreply@github.com>2024-08-05 11:23:06 -0400
commit257831582c759048ecce5c393993268b71a602e0 (patch)
tree0fb2f73589af0527da0bbad7a9f00a3b6330cf28 /libcxx/src
parent0b2d50c08d2eadf32f685fcd5b5468bc2ec7a16d (diff)
downloadllvm-257831582c759048ecce5c393993268b71a602e0.zip
llvm-257831582c759048ecce5c393993268b71a602e0.tar.gz
llvm-257831582c759048ecce5c393993268b71a602e0.tar.bz2
[libc++] Check correctly ref-qualified __is_callable in algorithms (#101553)
We were only checking that the comparator was rvalue callable, when in reality the algorithms always call comparators as lvalues. This patch also refactors the tests for callable requirements and expands it to a few missing algorithms. This is take 2 of #73451, which was reverted because it broke some CI bots. The issue was that we checked __is_callable with arguments in the wrong order inside std::upper_bound. This has now been fixed and a test was added. Fixes #69554
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/regex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/src/regex.cpp b/libcxx/src/regex.cpp
index 9dc0c69..6d9f06e 100644
--- a/libcxx/src/regex.cpp
+++ b/libcxx/src/regex.cpp
@@ -323,8 +323,8 @@ const classnames ClassNames[] = {
{"xdigit", ctype_base::xdigit}};
struct use_strcmp {
- bool operator()(const collationnames& x, const char* y) { return strcmp(x.elem_, y) < 0; }
- bool operator()(const classnames& x, const char* y) { return strcmp(x.elem_, y) < 0; }
+ bool operator()(const collationnames& x, const char* y) const { return strcmp(x.elem_, y) < 0; }
+ bool operator()(const classnames& x, const char* y) const { return strcmp(x.elem_, y) < 0; }
};
} // namespace