From: Jonathan Wakely Date: Fri, 19 Jun 2020 17:15:15 +0000 (+0100) Subject: libstdc++: Fix some -Wsystem-headers warnings (PR 95765) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b6215083bd6a3e10dd142e1c5d4fab011d6f074;p=gcc.git libstdc++: Fix some -Wsystem-headers warnings (PR 95765) PR libstdc++/95765 * include/bits/stl_algobase.h (__size_to_integer(float)) (__size_to_integer(double), __size_to_integer(long double)) (__size_to_integer(__float128)): Cast return type explicitly. * include/bits/stl_uninitialized.h (__uninitialized_default_1): Remove unused typedef. --- diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 41dd740d34a..4fc8850d707 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -1039,14 +1039,14 @@ _GLIBCXX_END_NAMESPACE_CONTAINER #endif inline _GLIBCXX_CONSTEXPR long long - __size_to_integer(float __n) { return __n; } + __size_to_integer(float __n) { return (long long)__n; } inline _GLIBCXX_CONSTEXPR long long - __size_to_integer(double __n) { return __n; } + __size_to_integer(double __n) { return (long long)__n; } inline _GLIBCXX_CONSTEXPR long long - __size_to_integer(long double __n) { return __n; } + __size_to_integer(long double __n) { return (long long)__n; } #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) inline _GLIBCXX_CONSTEXPR long long - __size_to_integer(__float128 __n) { return __n; } + __size_to_integer(__float128 __n) { return (long long)__n; } #endif template diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h index b5248fd49ea..a3ccb72078b 100644 --- a/libstdc++-v3/include/bits/stl_uninitialized.h +++ b/libstdc++-v3/include/bits/stl_uninitialized.h @@ -553,9 +553,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static void __uninit_default(_ForwardIterator __first, _ForwardIterator __last) { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - if (__first == __last) return;