Opened 9 years ago

Closed 9 years ago

#8686 closed Bugs (fixed)

Not compilable with exceptions disabled

Reported by: Norbert Riedlin <norbert.riedlin@…> Owned by: Christophe Henry
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@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

by Norbert Riedlin <norbert.riedlin@…>, 9 years ago

Attachment: state_machine.patch added

comment:1 by Norbert Riedlin <norbert.riedlin@…>, 9 years ago

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 by Christophe Henry, 9 years ago

Resolution: fixed
Status: newclosed
Version: Boost Development TrunkBoost 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.

Note: See TracTickets for help on using tickets.