Modify

Ticket #8686 (closed Bugs: fixed)

Opened 11 months ago

Last modified 7 months ago

Not compilable with exceptions disabled

Reported by: Norbert Riedlin <norbert.riedlin@…> Owned by: chenry
Milestone: To Be Determined Component: msm
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc: axel.sauerhoefer@…

Description

With disabled exceptions the code in do_process_helper() won't compile under gcc (Used version was llvm-gcc-4.2 under MacOSX 10.7.5) In the function template:

template <class StateType,class EventType>
HandledEnum do_process_helper(EventType const& evt, ::boost::mpl::false_ const &, bool is_direct_call)
try
{
    return this->do_process_event(evt,is_direct_call);
}
catch (std::exception& e)
{
    // give a chance to the concrete state machine to handle
    this->exception_caught(evt,*this,e);
}
//...
}

gcc will somehow forget about the formal parameter e in the catch clause but still insists on the code in the catch clause to be compilable. Apart from replacing try and catch by the boost macros BOOST_TRY etc. I also had to declare a local variable std::exception e that won't be used in any way apart from making the code compilable in the case without exceptions. See the attached patch file.

Attachments

state_machine.patch Download (1.1 KB) - added by Norbert Riedlin <norbert.riedlin@…> 11 months ago.

Change History

Changed 11 months ago by Norbert Riedlin <norbert.riedlin@…>

comment:1 Changed 11 months ago by Norbert Riedlin <norbert.riedlin@…>

Maybe it's obvious but I should mention that the function template is found in
$BOOST_TRUNK$/boost/msm/back/state_machine.hpp

comment:2 Changed 7 months ago by chenry

  • Status changed from new to closed
  • Version changed from Boost Development Trunk to Boost 1.55.0
  • Resolution set to fixed

Interesting that a local variable is needed. Works on VC, I still have to check that I get no warning on a newer gcc, will try this tomorrow.

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.