@@ -1034,7 +1034,9 @@ public:
1034
1034
// fails here for move_alloc.pass.cpp
1035
1035
1036
1036
#if _LIBCPP_STD_VER >= 26
1037
- if (__libcpp_is_constant_evaluated ()) {
1037
+ if constexpr (
1038
+ integral_constant<bool , is_copy_constructible<decltype (__value.first )>::value >()
1039
+ ) {
1038
1040
// static_assert(std::same_as_v<decltype(__value.first), double>);
1039
1041
// __emplace_hint_unique(__p, std::move(__value.first), std::move(__value.second));
1040
1042
@@ -1272,13 +1274,13 @@ private:
1272
1274
error: no matching constructor for initialization of '__get_node_value_type_t<value_type>' (aka 'std::pair<const MoveOnly, MoveOnly>')
1273
1275
# | 1225 | __get_node_value_type_t<value_type> __tmp(__rhs.first, __rhs.second);
1274
1276
*/
1275
- if ( __libcpp_is_constant_evaluated ()) {
1277
+ if constexpr (integral_constant< bool , is_copy_constructible_v<_From> > ()) {
1276
1278
// __move_from_value_type(__lhs, __rhs
1277
1279
// , integral_constant<bool, is_copy_constructible_v<_From> >()
1278
1280
// );
1279
1281
1280
1282
// TODO: narrow it to "_From.first"
1281
- if constexpr (integral_constant<bool , is_copy_constructible_v<_From> >()) {
1283
+ // if constexpr (integral_constant<bool, is_copy_constructible_v<_From> >()) {
1282
1284
// we use copy, and not "move" as the constraint
1283
1285
// because we can NOT move from `const key_type`, which is how `value_type` is defined
1284
1286
// atleast for map
@@ -1301,15 +1303,15 @@ error: no matching constructor for initialization of '__get_node_value_type_t<va
1301
1303
__node_traits::construct (__na, std::addressof (__lhs), std::move (__tmp));
1302
1304
1303
1305
1304
- } else {
1306
+ // } else {
1305
1307
1306
1308
// (void)__lhs;
1307
1309
// (void)__rhs;
1308
- static_assert (false , " Can not move from a pair<const T, U>" );
1310
+ // static_assert(false, "Can not move from a pair<const T, U>");
1309
1311
// TODO: how do I flag this code to NOT run at compile time?
1310
1312
// Using static_assert means this can't compile _at all_, regardless of whether this code is actually going to execute at compile time or not
1311
1313
1312
- }
1314
+ // }
1313
1315
1314
1316
1315
1317
0 commit comments