libstdc++: Fix variant build on 32-bit targets [PR95904]

libstdc++-v3/ChangeLog:

	* include/std/variant (__check_visitor_result):
	Use size_t for indexes.
	(__check_visitor_results): Likewise.
This commit is contained in:
Ville Voutilainen 2020-10-10 13:57:17 +03:00
parent 14db1dfcd1
commit 02cbd79e47

View File

@ -1714,7 +1714,7 @@ namespace __variant
template<typename _Tp, typename... _Types>
constexpr inline bool __same_types = (is_same_v<_Tp, _Types> && ...);
template <unsigned long int _Idx, typename _Visitor, typename _Variant>
template <size_t _Idx, typename _Visitor, typename _Variant>
decltype(auto)
__check_visitor_result(_Visitor&& __vis, _Variant&& __variant)
{
@ -1722,7 +1722,7 @@ namespace __variant
std::get<_Idx>(std::forward<_Variant>(__variant)));
}
template <typename _Visitor, typename _Variant, unsigned long int... _Idxs>
template <typename _Visitor, typename _Variant, size_t... _Idxs>
constexpr bool __check_visitor_results(std::index_sequence<_Idxs...>)
{
return __same_types<decltype(__check_visitor_result<_Idxs>(