Fix -Wempty-body warnings for debug assertions
authorJonathan Wakely <jwakely@redhat.com>
Fri, 1 Dec 2017 15:10:20 +0000 (15:10 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 1 Dec 2017 15:10:20 +0000 (15:10 +0000)
* 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
libstdc++-v3/include/bits/node_handle.h

index 053611ed2838cd22ae1f4093b2fb79a8acf286d0..8501a66fffa8f53556919650cb3255a1848e1a76 100644 (file)
@@ -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
index 7f109ada6f11b0e00d95846b287565b87bea9bfc..8a1e465893ecf810a5ca14abcc55d30b5c8d89d9 100644 (file)
@@ -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: