Modify

Opened 4 years ago

Closed 4 years ago

#8686 closed Bugs (fixed)

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 (1)

state_machine.patch (1.1 KB) - added by Norbert Riedlin <norbert.riedlin@…> 4 years ago.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by Norbert Riedlin <norbert.riedlin@…>

comment:1 Changed 4 years 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 4 years ago by chenry

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

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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain chenry.
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.