You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I did https://reviews.llvm.org/D142864 I add some static_casts.
Casey Carter explained why they are needed (the explanation is about Microsoft STL but it is the same for libc++):
We get here from one of two places: the initializer_list overload of operator() defined on 10084, or the range overload defined on 10096. If it's the former, we know that the value type of the range _Vty is copyable and the reference type is const _Vty& so *_Result.first implicitly converts to _Vty - we don't need the static_cast.
In the latter case, indirectly_copyable_storable<_It, _Vty*> (https://eel.is/c++draft/alg.req.ind.copy#2) also requires that _Vty is copyable, but the reference type of the input range (and _It) isn't necessarily const _Vty& so we don't have the same guarantee of implicit convertibility. In fact there's no requirement on that algorithm that lets us implicitly convert the result of an iterator dereference to _Vty. There is a requirement that constructible_from<_Vty, iter_reference_t<_It>> holds, however, so we can perform the conversion explicitly with static_cast.
While I did https://reviews.llvm.org/D142864 I add some
static_cast
s.Casey Carter explained why they are needed (the explanation is about Microsoft STL but it is the same for libc++):
An example of affected code:
llvm-project/libcxx/include/__algorithm/ranges_minmax.h
Line 80 in 4afb1ee
philnik wrote that we should check all algorithms for the issue.
The text was updated successfully, but these errors were encountered: