diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-10-29 22:47:22 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-10-29 22:47:22 +0000 |
commit | d7aa21a3c78874743a42ffc1af3493ecb665496f (patch) | |
tree | 6e6bfb3e0b9115156a774eceaaa6818ca3b71366 | |
parent | 52ddf0d458f063f6c9e07e726f9b46206f71e4c4 (diff) | |
download | gcc-d7aa21a3c78874743a42ffc1af3493ecb665496f.zip gcc-d7aa21a3c78874743a42ffc1af3493ecb665496f.tar.gz gcc-d7aa21a3c78874743a42ffc1af3493ecb665496f.tar.bz2 |
libstdc++: Fix some warnings in headers
These are usually suppressed in system headers, but should be fixed
anyway.
libstdc++-v3/ChangeLog:
* include/bits/parse_numbers.h (_Select_int_base): Avoid
narrowing conversion in constant expression.
* include/experimental/buffer (buffer_copy): Avoid narrowing
conversion.
* include/experimental/internet (hash<>::operator()): Do not
use deprecated 'argument_type' member.
* include/std/variant (variant::emplace): Use cast instead
of implicit conversion from size_t to narrower unsigned type.
-rw-r--r-- | libstdc++-v3/include/bits/parse_numbers.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/buffer | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/internet | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/std/variant | 6 |
4 files changed, 9 insertions, 7 deletions
diff --git a/libstdc++-v3/include/bits/parse_numbers.h b/libstdc++-v3/include/bits/parse_numbers.h index 5e80907..923a56c 100644 --- a/libstdc++-v3/include/bits/parse_numbers.h +++ b/libstdc++-v3/include/bits/parse_numbers.h @@ -266,7 +266,7 @@ namespace __select_int template<unsigned long long _Val, typename _IntType, typename... _Ints> struct _Select_int_base<_Val, _IntType, _Ints...> : conditional_t<(_Val <= __gnu_cxx::__int_traits<_IntType>::__max), - integral_constant<_IntType, _Val>, + integral_constant<_IntType, (_IntType)_Val>, _Select_int_base<_Val, _Ints...>> { }; diff --git a/libstdc++-v3/include/experimental/buffer b/libstdc++-v3/include/experimental/buffer index 8ccdb28..08d3a36 100644 --- a/libstdc++-v3/include/experimental/buffer +++ b/libstdc++-v3/include/experimental/buffer @@ -315,7 +315,7 @@ inline namespace v1 inline size_t buffer_copy(const _MutableBufferSequence& __dest, const _ConstBufferSequence& __source) noexcept - { return net::buffer_copy(__dest, __source, size_t{-1}); } + { return net::buffer_copy(__dest, __source, size_t(-1)); } // buffer arithmetic: diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet index f1153b8..1143ef4 100644 --- a/libstdc++-v3/include/experimental/internet +++ b/libstdc++-v3/include/experimental/internet @@ -2393,7 +2393,7 @@ namespace ip : __hash_base<size_t, experimental::net::v1::ip::address> { size_t - operator()(const argument_type& __a) const + operator()(const experimental::net::v1::ip::address& __a) const { if (__a.is_v4()) return _Hash_impl::hash(__a.to_v4()); @@ -2407,7 +2407,7 @@ namespace ip : __hash_base<size_t, experimental::net::v1::ip::address_v4> { size_t - operator()(const argument_type& __a) const + operator()(const experimental::net::v1::ip::address_v4& __a) const { return _Hash_impl::hash(__a.to_bytes()); } }; @@ -2415,7 +2415,7 @@ namespace ip : __hash_base<size_t, experimental::net::v1::ip::address_v6> { size_t - operator()(const argument_type& __a) const + operator()(const experimental::net::v1::ip::address_v6& __a) const { return _Hash_impl::hash(__a.to_bytes()); } }; diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 17f8bcd..4455ff4 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -1512,7 +1512,8 @@ namespace __variant } __catch (...) { - this->_M_index = variant_npos; + using __index_type = decltype(this->_M_index); + this->_M_index = static_cast<__index_type>(variant_npos); __throw_exception_again; } } @@ -1559,7 +1560,8 @@ namespace __variant } __catch (...) { - this->_M_index = variant_npos; + using __index_type = decltype(this->_M_index); + this->_M_index = static_cast<__index_type>(variant_npos); __throw_exception_again; } } |