aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-08-13 19:54:43 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-08-13 19:54:43 +0100
commitca086dda978dd10e7f26cf29aefa923d02cc1131 (patch)
tree4abe194bfec7f111a502449f06ccf812f1d6737c /libstdc++-v3
parent2383ed026914b85980520278455f97c270006d4d (diff)
downloadgcc-ca086dda978dd10e7f26cf29aefa923d02cc1131.zip
gcc-ca086dda978dd10e7f26cf29aefa923d02cc1131.tar.gz
gcc-ca086dda978dd10e7f26cf29aefa923d02cc1131.tar.bz2
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. From-SVN: r263516
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h12
2 files changed, 10 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5f4e822..312f39c 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,9 @@
2018-08-13 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/45093
+ * include/bits/stl_tree.h (_Rb_tree::_M_destroy_node(_Link_type)):
+ Combine definitions to avoid --detect-odr-violations warning.
+
* libsupc++/new_opa.cc (operator new(size_t, align_val_t)): Use
__is_pow2 to check for valid alignment. Avoid branching when rounding
size to multiple of alignment.
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index 0544f99..09e8d75 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