Opened 10 years ago
Closed 10 years ago
#7175 closed Bugs (fixed)
Rev 74766 breaks unordered_map on gcc 3.4
Reported by: | Owned by: | Daniel James | |
---|---|---|---|
Milestone: | To Be Determined | Component: | unordered |
Version: | Boost 1.50.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I was initially confronted to that bug with 1.50 and then I pinpointed the first bad rev using git bisect. Here is how to reproduce the problem:
~> gcc --version gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) ...
~> cat regress_unordered.cpp #include <boost/unordered_map.hpp> #include <iostream>
int main() {
boost::unordered_map<std::string, std::size_t> counts; countsone++; std::cout << countsone << std::endl;
}
~> g++ -c regress_unordered.cpp -I/path/to/boost
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp: In instantiation of `boost::unordered::detail::allocator_traits<std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > > >':
/home/luc/Developer/cctbx/boost/boost/unordered/detail/unique.hpp:155: instantiated from `boost::unordered::detail::pick_node<std::allocator<std::pair<const std::string, size_t> >, std::pair<const std::string, size_t> >'
/home/luc/Developer/cctbx/boost/boost/unordered/detail/unique.hpp:202: instantiated from `boost::unordered::detail::map<std::allocator<std::pair<const std::string, size_t> >, std::string, size_t, boost::hash<std::string>, std::equal_to<std::string> >'
/home/luc/Developer/cctbx/boost/boost/unordered/unordered_map.hpp:59: instantiated from `boost::unordered::unordered_map<std::string, size_t, boost::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<const std::string, size_t> > >'
regress_unordered.cpp:5: instantiated from here
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp:985: error: template<class T> static typename boost::disable_if_c<( boost::unordered::detail::has_construct<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > >]' and
template<class T> static typename boost::enable_if_c<( boost::unordered::detail::has_construct<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > >]' cannot be overloaded
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp:1005: error: template<class T> static typename boost::disable_if_c<( boost::unordered::detail::has_destroy<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > >]' and
template<class T> static typename boost::enable_if_c<( boost::unordered::detail::has_destroy<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > >]' cannot be overloaded
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp: In instantiation of `boost::unordered::detail::allocator_traits<std::allocator<boost::unordered::detail::ptr_bucket> >':
/home/luc/Developer/cctbx/boost/boost/unordered/detail/unique.hpp:155: instantiated from `boost::unordered::detail::pick_node<std::allocator<std::pair<const std::string, size_t> >, std::pair<const std::string, size_t> >'
/home/luc/Developer/cctbx/boost/boost/unordered/detail/unique.hpp:202: instantiated from `boost::unordered::detail::map<std::allocator<std::pair<const std::string, size_t> >, std::string, size_t, boost::hash<std::string>, std::equal_to<std::string> >'
/home/luc/Developer/cctbx/boost/boost/unordered/unordered_map.hpp:59: instantiated from `boost::unordered::unordered_map<std::string, size_t, boost::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<const std::string, size_t> > >'
regress_unordered.cpp:5: instantiated from here
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp:985: error: template<class T> static typename boost::disable_if_c<( boost::unordered::detail::has_construct<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' and
template<class T> static typename boost::enable_if_c<( boost::unordered::detail::has_construct<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' cannot be overloaded
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp:1005: error: template<class T> static typename boost::disable_if_c<( boost::unordered::detail::has_destroy<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' and
template<class T> static typename boost::enable_if_c<( boost::unordered::detail::has_destroy<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<boost::unordered::detail::ptr_bucket>]' cannot be overloaded
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp: In instantiation of `boost::unordered::detail::allocator_traits<std::allocator<std::pair<const std::string, size_t> > >':
/home/luc/Developer/cctbx/boost/boost/unordered/unordered_map.hpp:65: instantiated from `boost::unordered::unordered_map<std::string, size_t, boost::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<const std::string, size_t> > >'
regress_unordered.cpp:5: instantiated from here
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp:985: error: template<class T> static typename boost::disable_if_c<( boost::unordered::detail::has_construct<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<std::pair<const std::string, size_t> >]' and
template<class T> static typename boost::enable_if_c<( boost::unordered::detail::has_construct<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::construct(Alloc&, T*, const T&) [with T = T, Alloc = std::allocator<std::pair<const std::string, size_t> >]' cannot be overloaded
/home/luc/Developer/cctbx/boost/boost/unordered/detail/allocate.hpp:1005: error: template<class T> static typename boost::disable_if_c<( boost::unordered::detail::has_destroy<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<std::pair<const std::string, size_t> >]' and
template<class T> static typename boost::enable_if_c<( boost::unordered::detail::has_destroy<Alloc,T>::value && boost::is_same<T,typename Alloc::value_type>::value), void>::type boost::unordered::detail::allocator_traits::destroy(Alloc&, T*) [with T = T, Alloc = std::allocator<std::pair<const std::string, size_t> >]' cannot be overloaded
/home/luc/Developer/cctbx/boost/boost/unordered/detail/buckets.hpp: In member function `void boost::unordered::detail::buckets<A, Bucket, Node, Policy>::create_buckets() [with A = std::allocator<std::pair<const std::string, size_t> >, Bucket = boost::unordered::detail::ptr_bucket, Node = boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> >, Policy = boost::unordered::detail::prime_policy<size_t>]':
/home/luc/Developer/cctbx/boost/boost/unordered/detail/table.hpp:403: instantiated from `void boost::unordered::detail::table<Types>::reserve_for_insert(size_t) [with Types = boost::unordered::detail::map<std::allocator<std::pair<const std::string, size_t> >, std::string, size_t, boost::hash<std::string>, std::equal_to<std::string> >]'
/home/luc/Developer/cctbx/boost/boost/unordered/detail/unique.hpp:402: instantiated from `typename boost::unordered::detail::table<Types>::value_type& boost::unordered::detail::table_impl<Types>::operator[](const typename boost::unordered::detail::table<Types>::key_type&) [with Types = boost::unordered::detail::map<std::allocator<std::pair<const std::string, size_t> >, std::string, size_t, boost::hash<std::string>, std::equal_to<std::string> >]'
/home/luc/Developer/cctbx/boost/boost/unordered/unordered_map.hpp:1195: instantiated from `typename boost::unordered::unordered_map<K, T, H, P, A>::mapped_type& boost::unordered::unordered_map<K, T, H, P, A>::operator[](const K&) [with K = std::string, T = size_t, H = boost::hash<std::string>, P = std::equal_to<std::string>, A = std::allocator<std::pair<const std::string, size_t> >]'
regress_unordered.cpp:6: instantiated from here
/home/luc/Developer/cctbx/boost/boost/unordered/detail/buckets.hpp:726: error: no matching function for call to `boost::unordered::detail::allocator_traits<std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > > >::construct(std::allocator<boost::unordered::detail::ptr_node<std::pair<const std::string, size_t> > >&, boost::unordered::detail::ptr_bucket*, boost::unordered::detail::ptr_bucket)'
Change History (5)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Status: | new → assigned |
---|
I don't really support anything earlier than gcc 4.0 nowadays, but I'll try to fix this in trunk soon. I made a similar change to boost::hash recently for integers, so can you try running the hash regression tests?
comment:4 by , 10 years ago
I can confirm that rev 79762 fixed the problem I reported. Thanks a bunch!
For the record, the project on the behalf of which I prepared the bug report (Phenix, http://www.phenix-online.org) is actively trying to move to gcc > 4.0 as well but some clients are stuck with gcc 3.4. Thanks to you, they get some more mileage while we can work with a recent Boost version, and therefore avoid issues at the other end of the spectrum with the latest compiler releases.
Thanks again!
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I got the formatting of the snippet wrong, sorry: