Modify

Ticket #5117 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

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

Reported by: anonymous Owned by: chenry
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

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

Change History

Changed 3 years ago by Kozlov Taras

Changed 3 years ago by Kozlov Taras

comment:1 Changed 3 years ago by anonymous

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) (defined (APPLE_CC) && (GNUC == 4 && GNUC_MINOR < 1)) (defined(_MSC_VER) && (_MSC_VER < 1400))

+#if defined (IBMCPP)
(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) (defined (APPLE_CC) && (GNUC == 4 && GNUC_MINOR < 1)) (defined(_MSC_VER) && (_MSC_VER < 1400))

+#if defined (IBMCPP)
(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 Changed 3 years ago by chenry

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 Changed 3 years ago by chenry

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from To Be Determined to Boost 1.47.0
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.