Opened 9 years ago
Closed 9 years ago
#8686 closed Bugs (fixed)
Not compilable with exceptions disabled
Reported by: | 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)
Change History (3)
by , 9 years ago
Attachment: | state_machine.patch added |
---|
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Version: | Boost Development Trunk → 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.
Maybe it's obvious but I should mention that the function template is found in
$BOOST_TRUNK$/boost/msm/back/state_machine.hpp