[libcxx-commits] [libcxx] [libc++] Fix LWG 4265: std::midpoint should not accept const bool (PR #174579)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 9 03:08:59 PST 2026


================
@@ -29,6 +29,12 @@ void* vp       = nullptr;
 void test() {
   // expected-error at +1 {{no matching function for call to 'midpoint'}}
   (void)std::midpoint(false, true);
+  // expected-error at +1 {{no matching function for call to 'midpoint'}}
+  (void)std::midpoint<const bool>(false, true);
+  // expected-error at +1 {{no matching function for call to 'midpoint'}}
+  (void)std::midpoint<const volatile bool>(false, true);
+  // expected-error at +1 {{no matching function for call to 'midpoint'}}
+  (void)std::midpoint<volatile bool>(false, true);
----------------
eiytoq wrote:

Thanks for the feedback. Since this PR is already merged, I will open a follow-up PR to convert these into proper SFINAE tests. I'll also include some general cleanup of `midpoint`.

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


More information about the libcxx-commits mailing list