PR libstdc++/45093
        * include/bits/stl_tree.h (_Rb_tree::_M_destroy_node(_Link_type)):
        Combine definitions to avoid --detect-odr-violations warning.

Tested x86_64-linux, committed to trunk.


commit 99bf8add336b2307c09f122c8913ce9798a4cc6a
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Mon Aug 13 13:58:49 2018 +0100

    PR libstdc++/45093 avoid warnings for _M_destroy_node
    
            PR libstdc++/45093
            * include/bits/stl_tree.h (_Rb_tree::_M_destroy_node(_Link_type)):
            Combine definitions to avoid --detect-odr-violations warning.

diff --git a/libstdc++-v3/include/bits/stl_tree.h 
b/libstdc++-v3/include/bits/stl_tree.h
index 0544f99f9ab..09e8d758873 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -626,10 +626,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _M_construct_node(__tmp, __x);
        return __tmp;
       }
-
-      void
-      _M_destroy_node(_Link_type __p)
-      { get_allocator().destroy(__p->_M_valptr()); }
 #else
       template<typename... _Args>
        void
@@ -658,14 +654,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          _M_construct_node(__tmp, std::forward<_Args>(__args)...);
          return __tmp;
        }
+#endif
 
       void
-      _M_destroy_node(_Link_type __p) noexcept
+      _M_destroy_node(_Link_type __p) _GLIBCXX_NOEXCEPT
       {
+#if __cplusplus < 201103L
+       get_allocator().destroy(__p->_M_valptr());
+#else
        _Alloc_traits::destroy(_M_get_Node_allocator(), __p->_M_valptr());
        __p->~_Rb_tree_node<_Val>();
-      }
 #endif
+      }
 
       void
       _M_drop_node(_Link_type __p) _GLIBCXX_NOEXCEPT

Reply via email to