Opened 12 years ago

Closed 12 years ago

#5117 closed Bugs (fixed)

back/state_machine.hpp doesn`t compile with gcc 4.0.x version

Reported by: anonymous Owned by: Christophe Henry
Milestone: Boost 1.47.0 Component: msm
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

Here is small patch that resolve problem.

Compilation errors look like following:

/home/esuitebuild/boost_1_45_0/boost/msm/back/state_machine.hpp:2192: error: 'template<class StateType> typename boost::enable_if<typename boost::msm::back::is_no_message_queue<StateType>:\ :type, void>::type boost::msm::back::state_machine::process_message_queue(StateType*) [with StateType = StateType, Derived = net2::proto::a2s::client::machine_fe_t::st_connected_, HistoryP\ olicy = boost::msm::back::NoHistory, CompilePolicy = boost::msm::back::favor_runtime_speed]' cannot be overloaded /home/esuitebuild/boost_1_45_0/boost/msm/back/state_machine.hpp:2181: error: with 'template<class StateType> typename boost::disable_if<typename boost::msm::back::is_no_message_queue<State\ Type>::type, void>::type boost::msm::back::state_machine::process_message_queue(StateType*) [with StateType = StateType, Derived = net2::proto::a2s::client::machine_fe_t::st_connected_, Hi\ storyPolicy = boost::msm::back::NoHistory, CompilePolicy = boost::msm::back::favor_runtime_speed]' /home/esuitebuild/boost_1_45_0/boost/msm/back/state_machine.hpp: In instantiation of 'boost::msm::back::state_machine<net2::proto::a2s::client::machine_fe_t, boost::msm::back::NoHistory, b\ oost::msm::back::favor_runtime_speed>': /home/esuitebuild/boost_1_45_0/boost/msm/back/state_machine.hpp:2192: error: 'template<class StateType> typename boost::enable_if<typename boost::msm::back::is_no_message_queue<StateType>:\ :type, void>::type boost::msm::back::state_machine::process_message_queue(StateType*) [with StateType = StateType, Derived = net2::proto::a2s::client::machine_fe_t, HistoryPolicy = boost::\ msm::back::NoHistory, CompilePolicy = boost::msm::back::favor_runtime_speed]' cannot be overloaded /home/esuitebuild/boost_1_45_0/boost/msm/back/state_machine.hpp:2181: error: with 'template<class StateType> typename boost::disable_if<typename boost::msm::back::is_no_message_queue<State\ Type>::type, void>::type boost::msm::back::state_machine::process_message_queue(StateType*) [with StateType = StateType, Derived = net2::proto::a2s::client::machine_fe_t, HistoryPolicy = b\ oost::msm::back::NoHistory, CompilePolicy = boost::msm::back::favor_runtime_speed]'

Attachments (2)

02-msm-gcc402-compile-fix.patch (2.1 KB ) - added by Kozlov Taras 12 years ago.
02-msm-gcc402-compile-fix.2.patch (2.1 KB ) - added by Kozlov Taras 12 years ago.

Download all attachments as: .zip

Change History (5)

by Kozlov Taras, 12 years ago

by Kozlov Taras, 12 years ago

comment:1 by anonymous, 12 years ago

I can`t attach patch file, may be some problems with traq. Post it here diff -rub boost_1_45_0_old/boost/msm/back/state_machine.hpp boost_1_45_0/boost/msm/back/state_machine.hpp --- boost_1_45_0_old/boost/msm/back/state_machine.hpp 2010-12-03 17:04:12.000000000 +0300 +++ boost_1_45_0/boost/msm/back/state_machine.hpp 2011-01-25 13:36:43.000000000 +0300 @@ -1775,7 +1775,7 @@

the IBM compiler seems to have problems with nested classes the same seems to apply to the Apple version of gcc 4.0.1 (just in case we do for < 4.1) and also to MS VC < 8

-#if defined (IBMCPP) +#if defined (IBMCPP)
(defined (APPLE_CC) && (GNUC == 4 && GNUC_MINOR < 1)) (defined(_MSC_VER) && (_MSC_VER < 1400))
(GNUC == 4 && GNUC_MINOR < 1) (defined(_MSC_VER) && (_MSC_VER < 1400))

public:

#endif

template<class ContainingSM>

@@ -1784,7 +1784,7 @@

m_is_included=true; ::boost::fusion::for_each(m_substate_list,add_state<ContainingSM>(this,sm));

}

-#if defined (IBMCPP) +#if defined (IBMCPP)
(defined (APPLE_CC) && (GNUC == 4 && GNUC_MINOR < 1)) (defined(_MSC_VER) && (_MSC_VER < 1400))
(GNUC == 4 && GNUC_MINOR < 1) (defined(_MSC_VER) && (_MSC_VER < 1400))

private:

#endif

A function object for use with mpl::for_each that stuffs

@@ -2177,8 +2177,7 @@

} removes one event from the message queue and processes it template <class StateType>

  • typename ::boost::disable_if<typename is_no_message_queue<StateType>::type,void >::type
  • process_message_queue(StateType*)

+ void process_message_queue(StateType*, typename ::boost::disable_if<typename is_no_message_queue<StateType>::type,void >::type* = 0)

{

if (!m_events_queue.m_events_queue.empty()) {

@@ -2188,8 +2187,7 @@

}

} template <class StateType>

  • typename ::boost::enable_if<typename is_no_message_queue<StateType>::type,void >::type
  • process_message_queue(StateType*)

+ void process_message_queue(StateType*, typename ::boost::enable_if<typename is_no_message_queue<StateType>::type,void >::type* = 0)

{

nothing to process

}

comment:2 by Christophe Henry, 12 years ago

Ah, this is interesting. Here the link to the corresponding previous discussion: http://lists.boost.org/Archives/boost/2010/09/171281.php

It seems that the problem is not limited to Apple. What OS are you using?

Will be fixed for 1.47 (1.46 is closed). Fixed in trunk (rev 68535).

Thanks, Christophe

comment:3 by Christophe Henry, 12 years ago

Milestone: To Be DeterminedBoost 1.47.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.