From: Jonathan Wakely Date: Fri, 1 Dec 2017 15:10:20 +0000 (+0000) Subject: Fix -Wempty-body warnings for debug assertions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b7b61489b70179c2046df453897f4461c0ea710a;p=gcc.git 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 --- 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: