[libcxx-commits] [libcxx] 676fc58 - [libc++] Fix use of static in constexpr (#175667)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 14 06:08:18 PST 2026


Author: Prabhu Rajasekaran
Date: 2026-01-14T06:08:14-08:00
New Revision: 676fc5874423580c678f5fa3066430bf3d4b84ad

URL: https://github.com/llvm/llvm-project/commit/676fc5874423580c678f5fa3066430bf3d4b84ad
DIFF: https://github.com/llvm/llvm-project/commit/676fc5874423580c678f5fa3066430bf3d4b84ad.diff

LOG: [libc++] Fix use of static in constexpr (#175667)

Added: 
    

Modified: 
    libcxx/include/__algorithm/equal.h
    libcxx/include/__algorithm/ranges_equal.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/equal.h b/libcxx/include/__algorithm/equal.h
index 957cc29759424..753cac5a469e4 100644
--- a/libcxx/include/__algorithm/equal.h
+++ b/libcxx/include/__algorithm/equal.h
@@ -247,7 +247,7 @@ equal(_InputIterator1 __first1,
       _InputIterator2 __first2,
       _InputIterator2 __last2,
       _BinaryPredicate __pred) {
-  static constexpr bool __both_random_access =
+  constexpr bool __both_random_access =
       __has_random_access_iterator_category<_InputIterator1>::value &&
       __has_random_access_iterator_category<_InputIterator2>::value;
   if constexpr (__both_random_access) {

diff  --git a/libcxx/include/__algorithm/ranges_equal.h b/libcxx/include/__algorithm/ranges_equal.h
index 8eb2fc1017f28..98f0baaabc29d 100644
--- a/libcxx/include/__algorithm/ranges_equal.h
+++ b/libcxx/include/__algorithm/ranges_equal.h
@@ -50,7 +50,7 @@ struct __equal {
       _Pred __pred   = {},
       _Proj1 __proj1 = {},
       _Proj2 __proj2 = {}) const {
-    static constexpr bool __both_sized = sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>;
+    constexpr bool __both_sized = sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>;
     if constexpr (__both_sized) {
       if (__last1 - __first1 != __last2 - __first2)
         return false;
@@ -71,7 +71,7 @@ struct __equal {
     requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
       _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
-    static constexpr bool __both_sized = sized_range<_Range1> && sized_range<_Range2>;
+    constexpr bool __both_sized = sized_range<_Range1> && sized_range<_Range2>;
     if constexpr (__both_sized) {
       if (ranges::size(__range1) != ranges::size(__range2))
         return false;


        


More information about the libcxx-commits mailing list