Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions stl/inc/vector
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,11 @@ private:
_Newvec = _Allocate_at_least_helper(_Al, _Newcapacity);
} else {
_STL_INTERNAL_STATIC_ASSERT(_Policy == _Reallocation_policy::_Exactly);
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-11060638
_Newvec = _Al.allocate(_Newcapacity) + decltype(pointer{} - pointer{}){0};
#else // ^^^ workaround / no workaround vvv
_Newvec = _Al.allocate(_Newcapacity);
#endif // ^^^ no workaround ^^^
}

_Allocation_guard<_Alty> _Guard{_Al, _Newvec, _Newcapacity};
Expand Down
9 changes: 9 additions & 0 deletions stl/inc/xmemory
Original file line number Diff line number Diff line change
Expand Up @@ -2320,11 +2320,20 @@ _NODISCARD_RAW_PTR_ALLOC _CONSTEXPR20 typename allocator_traits<_Alloc>::pointer
if constexpr (_Should_allocate_at_least<_Alloc>) {
auto [_Ptr, _Allocated] = _Al.allocate_at_least(_Count);
_Count = _Allocated;
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-11060638
return _Ptr + decltype(_Ptr - _Ptr){0};
#else // ^^^ workaround / no workaround vvv
return _Ptr;
#endif // ^^^ no workaround ^^^
} else
#endif // _HAS_CXX23
{
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-11060638
using _Pointer = decltype(_Al.allocate(_Count));
return _Al.allocate(_Count) + decltype(_Pointer{} - _Pointer{}){0};
#else // ^^^ workaround / no workaround vvv
return _Al.allocate(_Count);
#endif // ^^^ no workaround ^^^
}
}

Expand Down
4 changes: 0 additions & 4 deletions tests/std/tests/P1004R2_constexpr_vector/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,15 +679,11 @@ constexpr bool test_vector_of_array() {
#endif // !_HAS_CXX23
{
test_vector_of_array_impl<unique_ptr<vector<char>>, 1>();
#if defined(__clang__) || defined(__EDG__) // TRANSITION, GH-6155 (not yet reported to MSVC)
test_vector_of_array_impl<unique_ptr<vector<char>>, 42>();
#endif // ^^^ no workaround ^^^
}

test_vector_of_array_impl<vector<long>, 1>();
#if defined(__clang__) || defined(__EDG__) // TRANSITION, GH-6155 (not yet reported to MSVC)
test_vector_of_array_impl<vector<long>, 42>();
#endif // ^^^ no workaround ^^^

return true;
}
Expand Down