aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-11-18 12:46:02 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2019-11-18 12:46:02 +0000
commit3b39526e0a34a41f916f80bcb45f2e1c64dcf763 (patch)
tree971414e140f7bff8ea233a8ae3a6cce92cd7e2b6
parent5be106b86006e00c80bf846a172b2b69b40d10ef (diff)
downloadgcc-3b39526e0a34a41f916f80bcb45f2e1c64dcf763.zip
gcc-3b39526e0a34a41f916f80bcb45f2e1c64dcf763.tar.gz
gcc-3b39526e0a34a41f916f80bcb45f2e1c64dcf763.tar.bz2
libstdc++: Fix some -Wsystem-headers warnings
* include/bits/alloc_traits.h (allocator_traits::construct) (allocator_traits::destroy, allocator_traits::max_size): Add unused attributes to parameters that are not used in C++20. * include/std/bit (__ceil2): Add braces around assertion to avoid -Wmissing-braces warning. From-SVN: r278401
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/alloc_traits.h9
-rw-r--r--libstdc++-v3/include/std/bit4
3 files changed, 16 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 48b5c9b..d2162ae 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2019-11-18 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/alloc_traits.h (allocator_traits::construct)
+ (allocator_traits::destroy, allocator_traits::max_size): Add unused
+ attributes to parameters that are not used in C++20.
+ * include/std/bit (__ceil2): Add braces around assertion to avoid
+ -Wmissing-braces warning.
+
2019-11-16 Edward Smith-Rowland <3dw4rd@verizon.net>
Repair the <tuple> part of C++20 p1032 Misc constexpr bits.
diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index 55211ac..142b23f 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -499,8 +499,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
template<typename _Up, typename... _Args>
static _GLIBCXX20_CONSTEXPR void
- construct(allocator_type& __a, _Up* __p, _Args&&... __args)
- noexcept(noexcept(::new((void*)__p) _Up(std::forward<_Args>(__args)...)))
+ construct(allocator_type& __a __attribute__((__unused__)), _Up* __p,
+ _Args&&... __args)
+ noexcept(noexcept(::new((void*)__p) _Up(std::declval<_Args>()...)))
{
#if __cplusplus <= 201703L
__a.construct(__p, std::forward<_Args>(__args)...);
@@ -518,7 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
template<typename _Up>
static _GLIBCXX20_CONSTEXPR void
- destroy(allocator_type& __a, _Up* __p)
+ destroy(allocator_type& __a __attribute__((__unused__)), _Up* __p)
noexcept(is_nothrow_destructible<_Up>::value)
{
#if __cplusplus <= 201703L
@@ -534,7 +535,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @return @c __a.max_size()
*/
static _GLIBCXX20_CONSTEXPR size_type
- max_size(const allocator_type& __a) noexcept
+ max_size(const allocator_type& __a __attribute__((__unused__))) noexcept
{
#if __cplusplus <= 201703L
return __a.max_size();
diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit
index e89bca2..7b5253b 100644
--- a/libstdc++-v3/include/std/bit
+++ b/libstdc++-v3/include/std/bit
@@ -225,7 +225,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// by UBSan, and by debug assertions.
#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
if (!__builtin_is_constant_evaluated())
- __glibcxx_assert( __shift_exponent != numeric_limits<_Tp>::digits );
+ {
+ __glibcxx_assert( __shift_exponent != numeric_limits<_Tp>::digits );
+ }
#endif
using __promoted_type = decltype(__x << 1);
if _GLIBCXX17_CONSTEXPR (!is_same<__promoted_type, _Tp>::value)