Skip to content

Commit 59b4621

Browse files
[libc++] Fix use of static in constexpr (#160180)
`static` is not allowed inside constexpr functions in C++ versions below 23. This is causing a build error when compiled with GCC and warning when compiled with Clang. This patch fixes this. --------- Co-authored-by: A. Jiang <[email protected]>
1 parent 203f21b commit 59b4621

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/__algorithm/make_heap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
3636
using __diff_t = __iter_diff_t<_RandomAccessIterator>;
3737
const __diff_t __n = __last - __first;
3838

39-
static const bool __assume_both_children = is_arithmetic<__iter_value_type<_RandomAccessIterator> >::value;
39+
const bool __assume_both_children = is_arithmetic<__iter_value_type<_RandomAccessIterator> >::value;
4040

4141
// While it would be correct to always assume we have both children, in practice we observed this to be a performance
4242
// improvement only for arithmetic types.

0 commit comments

Comments
 (0)