[Boost-bugs] [Boost C++ Libraries] #4999: boost-log from SVN doesn't compile on gcc 4.6

Subject: [Boost-bugs] [Boost C++ Libraries] #4999: boost-log from SVN doesn't compile on gcc 4.6
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-18 16:24:17


#4999: boost-log from SVN doesn't compile on gcc 4.6
---------------------------------+------------------------------------------
 Reporter: sean@… | Owner: andysem
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: Building Boost
  Version: Boost 1.45.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 I'm attempting to use boost-log from SVN with boost 1.45.0 on Darwin w/
 gcc 4.6. When I attempt to compile it, the following code:

 // boost_1_45_0/libs/signals/src/named_slot_map.cpp:94

 void named_slot_map::disconnect(const stored_group& name)
 {
   group_iterator group = groups.find(name);
   if (group != groups.end()) {
     slot_pair_iterator i = group->second.begin();
     while (i != group->second.end()) {
       slot_pair_iterator next = i;
       ++next;
       i->first.disconnect();
       i = next;
     }
     groups.erase(group);
   }
 }

 Gives me the following error:


 darwin.compile.c++ bin.v2/libs/signals/build/darwin-4.6.0/debug/link-
 static/named_slot_map.o

     "/opt/local/bin/g++-mp-4.6" -ftemplate-depth-128 -O0 -fno-inline
 -Wall -g -gdwarf-2 -DBOOST_ALL_NO_LIB=1 -DBOOST_SIGNALS_NO_LIB=1 -I"."
 -c -o "bin.v2/libs/signals/build/darwin-4.6.0/debug/link-
 static/named_slot_map.o" "libs/signals/src/named_slot_map.cpp"

 In file included from /opt/local/include/gcc46/c++/map:61:0,
                  from ./boost/signals/detail/named_slot_map.hpp:20,
                  from libs/signals/src/named_slot_map.cpp:12:
 /opt/local/include/gcc46/c++/bits/stl_map.h: In member function 'void
 std::map<_Key, _Tp, _Compare, _Alloc>::erase(std::map<_Key, _Tp, _Compare,
 _Alloc>::iterator) [with _Key = boost::signals::detail::stored_group, _Tp
 = std::list<boost::signals::detail::connection_slot_pair>, _Compare =
 boost::function2<bool, boost::signals::detail::stored_group,
 boost::signals::detail::stored_group>, _Alloc =
 std::allocator<std::pair<const boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >,
 std::map<_Key, _Tp, _Compare, _Alloc>::iterator =
 std::_Rb_tree_iterator<std::pair<const
 boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >]':
 libs/signals/src/named_slot_map.cpp:105:23: instantiated from here
 /opt/local/include/gcc46/c++/bits/stl_map.h:626:9: error: call of
 overloaded 'erase(std::map<boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair>,
 boost::function2<bool, boost::signals::detail::stored_group,
 boost::signals::detail::stored_group> >::iterator&)' is ambiguous
 /opt/local/include/gcc46/c++/bits/stl_map.h:626:9: note: candidates are:
 /opt/local/include/gcc46/c++/bits/stl_tree.h:763:7: note: void
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
 _Alloc>::erase(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
 _Alloc>::const_iterator) [with _Key =
 boost::signals::detail::stored_group, _Val = std::pair<const
 boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> >, _KeyOfValue =
 std::_Select1st<std::pair<const boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >, _Compare =
 boost::function2<bool, boost::signals::detail::stored_group,
 boost::signals::detail::stored_group>, _Alloc =
 std::allocator<std::pair<const boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >,
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator =
 std::_Rb_tree_const_iterator<std::pair<const
 boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >]
 /opt/local/include/gcc46/c++/bits/stl_tree.h:1490:5: note:
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::erase(const
 _Key&) [with _Key = boost::signals::detail::stored_group, _Val =
 std::pair<const boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> >, _KeyOfValue =
 std::_Select1st<std::pair<const boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >, _Compare =
 boost::function2<bool, boost::signals::detail::stored_group,
 boost::signals::detail::stored_group>, _Alloc =
 std::allocator<std::pair<const boost::signals::detail::stored_group,
 std::list<boost::signals::detail::connection_slot_pair> > >,
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type = long
 unsigned int]


 I also run in to another error:

 In file included from libs/log/src/global_logger_storage.cpp:22:0:
 ./boost/log/utility/type_info_wrapper.hpp: In destructor
 'boost::log_st::type_info_wrapper::auto_free::~auto_free()':
 ./boost/log/utility/type_info_wrapper.hpp:54:31: error: 'free' was not
 declared in this scope
 0.000009 sec system; 0.000043 sec user
 ...failed updating 1 target...

 And can fix this one:

 --- /tmp/type_info_wrapper.hpp 2010-12-18 08:21:03.000000000 -0800
 +++ obj/contrib-
 Darwin-i386/boost_1_45_0/boost/log/utility/type_info_wrapper.hpp
 2010-12-18 08:21:18.000000000 -0800
 @@ -13,6 +13,8 @@
  #ifndef BOOST_LOG_UTILITY_TYPE_INFO_WRAPPER_HPP_INCLUDED_
  #define BOOST_LOG_UTILITY_TYPE_INFO_WRAPPER_HPP_INCLUDED_

 +#include <stdlib.h>
 +
  #include <typeinfo>
  #include <string>
  #include <boost/log/detail/prologue.hpp>
 @@ -51,7 +53,7 @@
      struct auto_free
      {
          explicit auto_free(void* p) : p_(p) {}
 - ~auto_free() { free(p_); }
 + ~auto_free() { ::free(p_); }
      private:
          void* p_;
      };
 Exit 1

 gcc-mp-4.6 (GCC) 4.6.0 20101211 (experimental)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4999>
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-02-16 18:50:05 UTC