* [committed 2/5] libstdc++: Fix -Wdeprecated-declarations warnings
2020-09-10 18:17 [committed 1/5] libstdc++: Fix -Wnarrowing warnings Jonathan Wakely
@ 2020-09-10 18:18 ` Jonathan Wakely
2020-09-10 18:19 ` [committed 2/5] libstdc++: Fix macro redefinition warnings Jonathan Wakely
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Wakely @ 2020-09-10 18:18 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
* include/experimental/bits/shared_ptr.h (shared_ptr(auto_ptr&&))
(operator=(auto_ptr&&)): Add diagnostic pragmas to suppress
warnings for uses of std::auto_ptr.
* include/experimental/type_traits (is_literal_type_v):
Likewise, for use of std::is_literal_type.
* include/std/condition_variable (condition_variable_any::_Unlock):
Likewise, for use of std::uncaught_exception.
Tested powerpc64le-linux. Committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 3332 bytes --]
commit 0943b558171ffc731577c428d6c5f81897b6a034
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Sep 10 18:48:25 2020
libstdc++: Fix -Wdeprecated-declarations warnings
libstdc++-v3/ChangeLog:
* include/experimental/bits/shared_ptr.h (shared_ptr(auto_ptr&&))
(operator=(auto_ptr&&)): Add diagnostic pragmas to suppress
warnings for uses of std::auto_ptr.
* include/experimental/type_traits (is_literal_type_v):
Likewise, for use of std::is_literal_type.
* include/std/condition_variable (condition_variable_any::_Unlock):
Likewise, for use of std::uncaught_exception.
diff --git a/libstdc++-v3/include/experimental/bits/shared_ptr.h b/libstdc++-v3/include/experimental/bits/shared_ptr.h
index 953f5b78a5f..a32c1eef895 100644
--- a/libstdc++-v3/include/experimental/bits/shared_ptr.h
+++ b/libstdc++-v3/include/experimental/bits/shared_ptr.h
@@ -137,10 +137,13 @@ inline namespace fundamentals_v2
: _Base_type(__r) { }
#if _GLIBCXX_USE_DEPRECATED
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename _Tp1, typename = _Compatible<_Tp1>>
shared_ptr(std::auto_ptr<_Tp1>&& __r)
: _Base_type(std::move(__r))
{ _M_enable_shared_from_this_with(static_cast<_Tp1*>(this->get())); }
+#pragma GCC diagnostic pop
#endif
template<typename _Tp1, typename _Del,
@@ -187,6 +190,8 @@ inline namespace fundamentals_v2
}
#if _GLIBCXX_USE_DEPRECATED
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename _Tp1>
_Compatible<_Tp1, shared_ptr&>
operator=(std::auto_ptr<_Tp1>&& __r)
@@ -194,6 +199,7 @@ inline namespace fundamentals_v2
__shared_ptr<_Tp>::operator=(std::move(__r));
return *this;
}
+#pragma GCC diagnostic pop
#endif
template <typename _Tp1, typename _Del>
diff --git a/libstdc++-v3/include/experimental/type_traits b/libstdc++-v3/include/experimental/type_traits
index a92c385c029..11001bf184a 100644
--- a/libstdc++-v3/include/experimental/type_traits
+++ b/libstdc++-v3/include/experimental/type_traits
@@ -114,9 +114,9 @@ template <typename _Tp>
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template <typename _Tp>
constexpr bool is_pod_v = is_pod<_Tp>::value;
-#pragma GCC diagnostic pop
template <typename _Tp>
constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
+#pragma GCC diagnostic pop
template <typename _Tp>
constexpr bool is_empty_v = is_empty<_Tp>::value;
template <typename _Tp>
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 2db9dff6c31..a08cfc62705 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -266,6 +266,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); }
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
~_Unlock() noexcept(false)
{
if (uncaught_exception())
@@ -280,6 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
else
_M_lock.lock();
}
+#pragma GCC diagnostic pop
_Unlock(const _Unlock&) = delete;
_Unlock& operator=(const _Unlock&) = delete;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [committed 2/5] libstdc++: Fix macro redefinition warnings
2020-09-10 18:17 [committed 1/5] libstdc++: Fix -Wnarrowing warnings Jonathan Wakely
2020-09-10 18:18 ` [committed 2/5] libstdc++: Fix -Wdeprecated-declarations warnings Jonathan Wakely
@ 2020-09-10 18:19 ` Jonathan Wakely
2020-09-10 18:20 ` [committed 4/5] libstdc++: Fix -Wunused-local-typedefs warning Jonathan Wakely
2020-09-10 18:20 ` [committed 5/5] libstdc++: Fix -Wsign-compare warnings Jonathan Wakely
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Wakely @ 2020-09-10 18:19 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
Including <version> after <iterator> gives a warning about redefining
the __cpp_lib_array_constexpr macro. What happens is that <iterator>
sets the C++20 value, then <version> redefines it to the C++17 value,
then undefines it and defines it again to the C++20 value.
This change avoids defining it to the C++17 value when compiling C++20
or later (which also means we no longer need the #undef).
A similar warning happens for __cpp_lib_constexpr_char_traits when
including <version> after any header that includes <bits/char_traits.h>.
libstdc++-v3/ChangeLog:
* include/std/version (__cpp_lib_array_constexpr):
(__cpp_lib_constexpr_char_traits): Only define C++17 value when
compiling C++17.
Tested powerpc64le-linux. Committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 2165 bytes --]
commit f903c13ce8674c623f176eaf4516505205fefcf6
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Sep 10 18:51:24 2020
libstdc++: Fix macro redefinition warnings
Including <version> after <iterator> gives a warning about redefining
the __cpp_lib_array_constexpr macro. What happens is that <iterator>
sets the C++20 value, then <version> redefines it to the C++17 value,
then undefines it and defines it again to the C++20 value.
This change avoids defining it to the C++17 value when compiling C++20
or later (which also means we no longer need the #undef).
A similar warning happens for __cpp_lib_constexpr_char_traits when
including <version> after any header that includes <bits/char_traits.h>.
libstdc++-v3/ChangeLog:
* include/std/version (__cpp_lib_array_constexpr):
(__cpp_lib_constexpr_char_traits): Only define C++17 value when
compiling C++17.
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index f64aff4f520..d5d42ed0a72 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -122,12 +122,16 @@
#if _GLIBCXX_HOSTED
#define __cpp_lib_any 201606L
#define __cpp_lib_apply 201603
-#define __cpp_lib_array_constexpr 201803L
+#if __cplusplus == 201703L // N.B. updated value in C++20
+# define __cpp_lib_array_constexpr 201803L
+#endif
#define __cpp_lib_as_const 201510
#define __cpp_lib_boyer_moore_searcher 201603
#define __cpp_lib_chrono 201611
#define __cpp_lib_clamp 201603
-#define __cpp_lib_constexpr_char_traits 201611L
+#if __cplusplus == 201703L // N.B. updated value in C++20
+# define __cpp_lib_constexpr_char_traits 201611L
+#endif
#define __cpp_lib_enable_shared_from_this 201603
#define __cpp_lib_execution 201902L // FIXME: should be 201603L
#define __cpp_lib_filesystem 201703
@@ -191,8 +195,6 @@
#define __cpp_lib_unwrap_ref 201811L
#if _GLIBCXX_HOSTED
-#undef __cpp_lib_array_constexpr
-#undef __cpp_lib_constexpr_char_traits
#define __cpp_lib_array_constexpr 201811L
#define __cpp_lib_assume_aligned 201811L
#define __cpp_lib_bind_front 201907L
^ permalink raw reply [flat|nested] 5+ messages in thread
* [committed 4/5] libstdc++: Fix -Wunused-local-typedefs warning
2020-09-10 18:17 [committed 1/5] libstdc++: Fix -Wnarrowing warnings Jonathan Wakely
2020-09-10 18:18 ` [committed 2/5] libstdc++: Fix -Wdeprecated-declarations warnings Jonathan Wakely
2020-09-10 18:19 ` [committed 2/5] libstdc++: Fix macro redefinition warnings Jonathan Wakely
@ 2020-09-10 18:20 ` Jonathan Wakely
2020-09-10 18:20 ` [committed 5/5] libstdc++: Fix -Wsign-compare warnings Jonathan Wakely
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Wakely @ 2020-09-10 18:20 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 137 bytes --]
* include/bits/ranges_algobase.h (__equal_fn): Remove unused
typedef.
Tested powerpc64le-linux. Committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 857 bytes --]
commit 866c53cb2e88e172476185327723df9197c34ae7
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Sep 10 18:57:05 2020
libstdc++: Fix -Wunused-local-typedefs warning
libstdc++-v3/ChangeLog:
* include/bits/ranges_algobase.h (__equal_fn): Remove unused
typedef.
diff --git a/libstdc++-v3/include/bits/ranges_algobase.h b/libstdc++-v3/include/bits/ranges_algobase.h
index 3bdc7cc471b..2adff643ac2 100644
--- a/libstdc++-v3/include/bits/ranges_algobase.h
+++ b/libstdc++-v3/include/bits/ranges_algobase.h
@@ -105,7 +105,6 @@ namespace ranges
return false;
using _ValueType1 = iter_value_t<_Iter1>;
- using _ValueType2 = iter_value_t<_Iter2>;
constexpr bool __use_memcmp
= ((is_integral_v<_ValueType1> || is_pointer_v<_ValueType1>)
&& __memcmpable<_Iter1, _Iter2>::__value
^ permalink raw reply [flat|nested] 5+ messages in thread
* [committed 5/5] libstdc++: Fix -Wsign-compare warnings
2020-09-10 18:17 [committed 1/5] libstdc++: Fix -Wnarrowing warnings Jonathan Wakely
` (2 preceding siblings ...)
2020-09-10 18:20 ` [committed 4/5] libstdc++: Fix -Wunused-local-typedefs warning Jonathan Wakely
@ 2020-09-10 18:20 ` Jonathan Wakely
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Wakely @ 2020-09-10 18:20 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 197 bytes --]
* include/bits/locale_conv.h (__do_str_codecvt, __str_codecvt_in_all):
Add casts to compare types of the same signedness.
Tested powerpc64le-linux. Committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1227 bytes --]
commit 1d5589d11e61fa78b0c0e845728412b1cc6043d8
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Sep 10 18:57:39 2020
libstdc++: Fix -Wsign-compare warnings
libstdc++-v3/ChangeLog:
* include/bits/locale_conv.h (__do_str_codecvt, __str_codecvt_in_all):
Add casts to compare types of the same signedness.
diff --git a/libstdc++-v3/include/bits/locale_conv.h b/libstdc++-v3/include/bits/locale_conv.h
index 4a11e237623..f1d7032e8bc 100644
--- a/libstdc++-v3/include/bits/locale_conv.h
+++ b/libstdc++-v3/include/bits/locale_conv.h
@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__outchars = __outnext - &__outstr.front();
}
while (__result == codecvt_base::partial && __next != __last
- && (__outstr.size() - __outchars) < __maxlen);
+ && ptrdiff_t(__outstr.size() - __outchars) < __maxlen);
if (__result == codecvt_base::error)
{
@@ -142,7 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_State __state = {};
size_t __n;
return __str_codecvt_in(__first, __last, __outstr, __cvt, __state, __n)
- && (__n == (__last - __first));
+ && (__n == size_t(__last - __first));
}
// Convert wide character string to narrow.
^ permalink raw reply [flat|nested] 5+ messages in thread