diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-02-11 15:22:37 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-02-11 15:22:37 +0000 |
commit | 8e39768c21af7918a732ce15f62f2b62623196c0 (patch) | |
tree | 0f8ac0f9e647f7d6d4ee61363deeb48b9385064b /libcxx/include | |
parent | f478678549f6a57f708a1f8a8afd02004fdd1e50 (diff) | |
download | bcm5719-llvm-8e39768c21af7918a732ce15f62f2b62623196c0.tar.gz bcm5719-llvm-8e39768c21af7918a732ce15f62f2b62623196c0.zip |
Properly down-cast a sentinal node pointer through void*
llvm-svn: 260526
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/__hash_table | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index c35c6dfcdf5..b358d94873a 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -917,6 +917,7 @@ public: typedef typename _NodeTypes::__node_type __node; typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator; typedef allocator_traits<__node_allocator> __node_traits; + typedef typename _NodeTypes::__void_pointer __void_pointer; typedef typename _NodeTypes::__node_pointer __node_pointer; typedef typename _NodeTypes::__node_pointer __node_const_pointer; typedef typename _NodeTypes::__node_base_type __first_node; @@ -1955,7 +1956,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __node_pointer __pn = __bucket_list_[__chash]; if (__pn == nullptr) { - __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())); + __pn = static_cast<__node_pointer>(static_cast<__void_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))); __h->__next_ = __pn->__next_; __pn->__next_ = __h.get(); // fix up __bucket_list_ |