From b7b61489b70179c2046df453897f4461c0ea710a Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 1 Dec 2017 15:10:20 +0000 Subject: [PATCH] Fix -Wempty-body warnings for debug assertions * include/bits/node_handle.h (_Node_handle_common::operator=) (_Node_handle_common::_M_swap): Add braces around debug assertions. From-SVN: r255317 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/include/bits/node_handle.h | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 053611ed283..8501a66fffa 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2017-12-01 Jonathan Wakely + * include/bits/node_handle.h (_Node_handle_common::operator=) + (_Node_handle_common::_M_swap): Add braces around debug assertions. + * include/ext/ropeimpl.h (rope::_S_dump): Use const char*. * libsupc++/nested_exception.h (__throw_with_nested_impl): Add diff --git a/libstdc++-v3/include/bits/node_handle.h b/libstdc++-v3/include/bits/node_handle.h index 7f109ada6f1..8a1e465893e 100644 --- a/libstdc++-v3/include/bits/node_handle.h +++ b/libstdc++-v3/include/bits/node_handle.h @@ -87,10 +87,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION || !this->_M_alloc) this->_M_alloc = std::move(__nh._M_alloc); else - __glibcxx_assert(this->_M_alloc == __nh._M_alloc); + { + __glibcxx_assert(this->_M_alloc == __nh._M_alloc); + } } else - __glibcxx_assert(_M_alloc); + { + __glibcxx_assert(_M_alloc); + } __nh._M_ptr = nullptr; __nh._M_alloc = nullopt; return *this; @@ -109,7 +113,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION || !_M_alloc || !__nh._M_alloc) _M_alloc.swap(__nh._M_alloc); else - __glibcxx_assert(_M_alloc == __nh._M_alloc); + { + __glibcxx_assert(_M_alloc == __nh._M_alloc); + } } private: -- 2.30.2