id summary reporter owner description type status milestone component version severity resolution keywords cc 1596 [unordered] non-standard prototype of malloc_allocator<>::allocate (size_t, const_pointer) faridz@… Daniel James " The [http://stdcxx.apache.org/ stdcxx] is the another implementation of the STL (initially based on RogueWave STL). The following errors are encountered when running boost regression tests on msvc with stdcxx-4.2.0. {{{ assign_exception_tests.cpp D:\stdcxx\4.2.x\include\rw/_tree.cc(140) : error C2664: '__rw::__rb_tree<_Key,_Val,_KeyOf,_Comp,_Alloc>::_C_node_buf *test::malloc_allocator::allocate(test::malloc_allocator::size_type,const __rw::__rb_tree<_Key,_Val,_KeyOf,_Comp,_Alloc>::_C_node_buf *)' : cannot convert parameter 2 from 'void *' to 'const __rw::__rb_tree<_Key,_Val,_KeyOf,_Comp,_Alloc>::_C_node_buf *' with [ _Key=test::detail::memory_area, _Val=std::pair, _KeyOf=__rw::__select1st,test::detail::memory_area>, _Comp=test::detail::memory_area_compare, _Alloc=test::malloc_allocator>, T=__rw::__rb_tree,__rw::__select1st,test::detail::memory_area>,test::detail::memory_area_compare,test::malloc_allocator>>::_C_node_buf ] and [ _Key=test::detail::memory_area, _Val=std::pair, _KeyOf=__rw::__select1st,test::detail::memory_area>, _Comp=test::detail::memory_area_compare, _Alloc=test::malloc_allocator> ] Conversion from 'void*' to pointer to non-'void' requires an explicit cast D:\stdcxx\4.2.x\include\rw/_tree.cc(131) : while compiling class template member function 'void __rw::__rb_tree<_Key,_Val,_KeyOf,_Comp,_Alloc>::_C_add_new_buffer(void)' with [ _Key=test::detail::memory_area, _Val=std::pair, _KeyOf=__rw::__select1st,test::detail::memory_area>, _Comp=test::detail::memory_area_compare, _Alloc=test::malloc_allocator> ] D:\stdcxx\4.2.x\include\rw/_tree.cc(50) : while compiling class template member function '__rw::__rb_tree<_Key,_Val,_KeyOf,_Comp,_Alloc>::__rb_tree(const test::detail::memory_area_compare &,const test::malloc_allocator &)' with [ _Key=test::detail::memory_area, _Val=std::pair, _KeyOf=__rw::__select1st,test::detail::memory_area>, _Comp=test::detail::memory_area_compare, _Alloc=test::malloc_allocator>, T=std::pair ] D:\stdcxx\4.2.x\include\map(89) : see reference to class template instantiation '__rw::__rb_tree<_Key,_Val,_KeyOf,_Comp,_Alloc>' being compiled with [ _Key=test::detail::memory_area, _Val=std::pair, _KeyOf=__rw::__select1st,test::detail::memory_area>, _Comp=test::detail::memory_area_compare, _Alloc=test::malloc_allocator> ] d:\boost\boost\libs\unordered\test\objects\./memory.hpp(84) : see reference to class template instantiation 'std::map<_Key,_TypeT,_Compare,_Allocator>' being compiled with [ _Key=test::detail::memory_area, _TypeT=test::detail::memory_track, _Compare=test::detail::memory_area_compare, _Allocator=test::malloc_allocator> ] d:\boost\boost\libs\unordered\test\exception\../objects/exception.hpp(27) : see reference to class template instantiation 'test::detail::memory_tracker' being compiled with [ Alloc=test::malloc_allocator ] D:\stdcxx\4.2.x\include\rw/_tree.cc(144) : error C2664: '__rw::__rw_rb_tree_node<_Alloc,_Val,_Key,_KeyOf> *test::malloc_allocator::allocate(test::malloc_allocator::size_type,const __rw::__rw_rb_tree_node<_Alloc,_Val,_Key,_KeyOf> *)' : cannot convert parameter 2 from 'void *' to 'const __rw::__rw_rb_tree_node<_Alloc,_Val,_Key,_KeyOf> *' with [ _Alloc=test::malloc_allocator>, _Val=std::pair, _Key=test::detail::memory_area, _KeyOf=__rw::__select1st,test::detail::memory_area>, T=__rw::__rw_rb_tree_node>,std::pair,test::detail::memory_area,__rw::__select1st,test::detail::memory_area>> ] and [ _Alloc=test::malloc_allocator>, _Val=std::pair, _Key=test::detail::memory_area, _KeyOf=__rw::__select1st,test::detail::memory_area> ] Conversion from 'void*' to pointer to non-'void' requires an explicit cast }}} By the standard, the type of the second parameter of allocate() method should be allocator::const_pointer, where U - any type. So since the second parameter is not a template parameter, the only case is to be of allocator::const_pointer type. Or simple const void*. I propose to remove workarounds for IBM Visual Age and Apache STL and make const void* type for all implementations: {{{ Index: libs/unordered/test/helpers/allocator.hpp =================================================================== --- libs/unordered/test/helpers/allocator.hpp (revision 42908) +++ libs/unordered/test/helpers/allocator.hpp (working copy) @@ -45,13 +45,7 @@ return ptr; } - pointer allocate(size_type n, const_pointer u) { return allocate(n); } - -#if defined(__IBMCPP__) || BOOST_WORKAROUND(BOOST_RWSTD_VER, < 0x04020000) - // Workaround for IBM Visual Age and Rogue Wave (or maybe just Apache stdcxx?) - // which seem to use a void pointer for the second argument. pointer allocate(size_type n, void const* u) { return allocate(n); } -#endif void deallocate(pointer p, size_type) { using namespace std; }}} " Bugs closed Boost 1.36.0 unordered Boost Development Trunk Problem fixed