diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-12-01 15:10:20 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-12-01 15:10:20 +0000 |
commit | b7b61489b70179c2046df453897f4461c0ea710a (patch) | |
tree | 45268580f8041d731af0525ccc313c84d814f767 | |
parent | f1338a2dcb4f4cb805b853965c513bfaf5a71ff9 (diff) | |
download | gcc-b7b61489b70179c2046df453897f4461c0ea710a.zip gcc-b7b61489b70179c2046df453897f4461c0ea710a.tar.gz gcc-b7b61489b70179c2046df453897f4461c0ea710a.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 3 | ||||
-rw-r--r-- | 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 053611e..8501a66 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2017-12-01 Jonathan Wakely <jwakely@redhat.com> + * 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 7f109ad..8a1e465 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: |