Skip to content

Commit 1e86d9c

Browse files
failing at copy_assign.pass.cpp only in constexpr
1 parent 21c442c commit 1e86d9c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

libcxx/include/__tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::__assign_m
14281428
if (size() != 0) {
14291429
_DetachedTreeCache __cache(this);
14301430
for (; __cache.__get() && __first != __last; ++__first) {
1431+
// static_assert(std::is_same_v<decltype(__cache.__get()->__value_), bool>, "fail");
14311432
__cache.__get()->__value_ = *__first;
14321433
__node_insert_multi(__cache.__get());
14331434
__cache.__advance();

libcxx/include/map

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,17 +807,20 @@ public:
807807
return __nc_ref_pair_type(const_cast<key_type&>(__v.first), __v.second);
808808
}
809809

810-
_LIBCPP_HIDE_FROM_ABI __nc_rref_pair_type __move() {
810+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __nc_rref_pair_type __move() {
811811
value_type& __v = __get_value();
812812
return __nc_rref_pair_type(std::move(const_cast<key_type&>(__v.first)), std::move(__v.second));
813813
}
814814

815-
_LIBCPP_HIDE_FROM_ABI __value_type& operator=(const __value_type& __v) {
815+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __value_type& operator=(const __value_type& __v) {
816816
__ref() = __v.__get_value();
817+
818+
// note: modification of object of const-qualified type 'const int' is not allowed in a constant expression
819+
// raised by: libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
817820
return *this;
818821
}
819822

820-
_LIBCPP_HIDE_FROM_ABI __value_type& operator=(__value_type&& __v) {
823+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __value_type& operator=(__value_type&& __v) {
821824
__ref() = __v.__move();
822825
return *this;
823826
}

0 commit comments

Comments
 (0)