Skip to content

Commit e941811

Browse files
note: cast from 'void *' is not allowed in a constant expression because the pointed object type 'std::__tree_node<std::__value_type<int, double>, min_pointer<void>>' is not similar to the target type 'std::__tree_node_base<min_pointer<void>>'
1 parent ed995a2 commit e941811

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libcxx/include/__tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ private:
12701270
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_holder __construct_node(_Args&&... __args);
12711271

12721272
// TODO: Make this _LIBCPP_HIDE_FROM_ABI
1273-
_LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT;
1273+
_LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_SINCE_CXX26 void destroy(__node_pointer __nd) _NOEXCEPT;
12741274

12751275
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);
12761276
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(
@@ -1540,7 +1540,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::~__tree() {
15401540
}
15411541

15421542
template <class _Tp, class _Compare, class _Allocator>
1543-
void __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT {
1543+
_LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT {
15441544
if (__nd != nullptr) {
15451545
destroy(static_cast<__node_pointer>(__nd->__left_));
15461546
destroy(static_cast<__node_pointer>(__nd->__right_));

libcxx/test/std/containers/associative/map/map.access/at.pass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ TEST_CONSTEXPR_CXX26 bool test() {
7575
assert(m.at(3) == 3.5);
7676
assert(m.at(4) == 4.5);
7777
assert(m.at(5) == 5.5);
78-
#ifndef TEST_HAS_NO_EXCEPTIONS
78+
// throwing is not allowed in constexpr
79+
#if TEST_STD_VER < 26
7980
try {
8081
TEST_IGNORE_NODISCARD m.at(6);
8182
assert(false);
8283
} catch (std::out_of_range&) {
8384
}
8485
#endif
86+
8587
assert(m.at(7) == 7.5);
8688
assert(m.at(8) == 8.5);
8789
assert(m.size() == 7);

0 commit comments

Comments
 (0)