Subject: [Boost-bugs] [Boost C++ Libraries] #12968: avl_set: regression when sorting by void*
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-04-13 14:17:23
#12968: avl_set: regression when sorting by void*
------------------------------+------------------------
Reporter: j.gajdosik@⦠| Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: intrusive
Version: Boost 1.63.0 | Severity: Problem
Keywords: |
------------------------------+------------------------
The code below compiles (and works) well with boost-1.58, but failes to
compile with boost-1.59 and above:
-------compiler output of gcc version 4.9.4 (Gentoo 4.9.4 p1.0,
pie-0.6.4)------------------
In file included from /usr/include/boost/intrusive/bstree.hpp:33:0,
from /usr/include/boost/intrusive/avltree.hpp:24,
from /usr/include/boost/intrusive/avl_set.hpp:17,
from avl_test1.cpp:1:
/usr/include/boost/intrusive/detail/key_nodeptr_comp.hpp: In instantiation
of 'bool boost::intrusive::detail::key_nodeptr_comp<KeyTypeKeyCompare,
ValueTraits, KeyOfValue>::operator()(const T1&, typename
boost::move_detail::enable_if_c<boost::intrusive::detail::key_nodeptr_comp<KeyTypeKeyCompare,
ValueTraits,
KeyOfValue>::is_same_or_nodeptr_convertible<T1>::value>::type*) const
[with T1 = boost::intrusive::avltree_node<void*>*; KeyTypeKeyCompare =
EntryType::KeyCompareById; ValueTraits =
boost::intrusive::mhtraits<EntryType,
boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>;
KeyOfValue = boost::move_detail::identity<EntryType>; typename
boost::move_detail::enable_if_c<boost::intrusive::detail::key_nodeptr_comp<KeyTypeKeyCompare,
ValueTraits, KeyOfValue>::is_same_or_nodeptr_convertible<T1>::value>::type
= void]':
/usr/include/boost/intrusive/bstree_algorithms.hpp:2025:24: required
from 'static boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr
boost::intrusive::bstree_algorithms<NodeTraits>::lower_bound_loop(boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr,
boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr, const KeyType&,
KeyNodePtrCompare) [with KeyType = void*; KeyNodePtrCompare =
boost::intrusive::detail::key_nodeptr_comp<EntryType::KeyCompareById,
boost::intrusive::mhtraits<EntryType,
boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>,
boost::move_detail::identity<EntryType> >; NodeTraits =
boost::intrusive::avltree_node_traits<void*, false>;
boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr =
boost::intrusive::avltree_node<void*>*]'
/usr/include/boost/intrusive/bstree_algorithms.hpp:917:96: required from
'static boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr
boost::intrusive::bstree_algorithms<NodeTraits>::lower_bound(const
const_node_ptr&, const KeyType&, KeyNodePtrCompare) [with KeyType = void*;
KeyNodePtrCompare =
boost::intrusive::detail::key_nodeptr_comp<EntryType::KeyCompareById,
boost::intrusive::mhtraits<EntryType,
boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>,
boost::move_detail::identity<EntryType> >; NodeTraits =
boost::intrusive::avltree_node_traits<void*, false>;
boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr =
boost::intrusive::avltree_node<void*>*;
boost::intrusive::bstree_algorithms<NodeTraits>::const_node_ptr = const
boost::intrusive::avltree_node<void*>*]'
/usr/include/boost/intrusive/bstree_algorithms.hpp:751:49: required from
'static boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr
boost::intrusive::bstree_algorithms<NodeTraits>::find(const
const_node_ptr&, const KeyType&, KeyNodePtrCompare) [with KeyType = void*;
KeyNodePtrCompare =
boost::intrusive::detail::key_nodeptr_comp<EntryType::KeyCompareById,
boost::intrusive::mhtraits<EntryType,
boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>,
boost::move_detail::identity<EntryType> >; NodeTraits =
boost::intrusive::avltree_node_traits<void*, false>;
boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr =
boost::intrusive::avltree_node<void*>*;
boost::intrusive::bstree_algorithms<NodeTraits>::const_node_ptr = const
boost::intrusive::avltree_node<void*>*]'
/usr/include/boost/intrusive/bstree.hpp:382:83: required from
'boost::intrusive::bstbase2<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp,
AlgoType, HeaderHolder>::iterator boost::intrusive::bstbase2<ValueTraits,
VoidOrKeyOfValue, VoidOrKeyComp, AlgoType, HeaderHolder>::find(const
KeyType&, KeyTypeKeyCompare) [with KeyType = void*; KeyTypeKeyCompare =
EntryType::KeyCompareById; ValueTraits =
boost::intrusive::mhtraits<EntryType,
boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>;
VoidOrKeyOfValue = void; VoidOrKeyComp = EntryType::CompareById;
boost::intrusive::algo_types AlgoType = (boost::intrusive::algo_types)6u;
HeaderHolder = void; boost::intrusive::bstbase2<ValueTraits,
VoidOrKeyOfValue, VoidOrKeyComp, AlgoType, HeaderHolder>::iterator =
boost::intrusive::tree_iterator<boost::intrusive::mhtraits<EntryType,
boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>,
false>]'
avl_test1.cpp:33:39: required from here
/usr/include/boost/intrusive/detail/key_nodeptr_comp.hpp:87:69: error: no
match for call to '(EntryType::KeyCompareById) (const EntryType&)'
{ return base().get()(key_of_value()(*traits_->to_value_ptr(t1))); }
^
avl_test1.cpp:14:10: note: candidates are:
struct KeyCompareById {
^
avl_test1.cpp:15:10: note: bool
EntryType::KeyCompareById::operator()(void* const&, const EntryType&)
const
bool operator()(const Type &id,const EntryType &b) const
^
avl_test1.cpp:15:10: note: candidate expects 2 arguments, 1 provided
avl_test1.cpp:17:10: note: bool
EntryType::KeyCompareById::operator()(const EntryType&, void* const&)
const
bool operator()(const EntryType &a,const Type &id) const
^
avl_test1.cpp:17:10: note: candidate expects 2 arguments, 1 provided
----------------------end of compiler
output---------------------------------
Note: when writing "typedef int *Type;" instead of "typedef void *Type;"
it compiles.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12968> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-04-13 14:20:32 UTC