Boost C++ Libraries: Ticket #8686: Not compilable with exceptions disabled https://svn.boost.org/trac10/ticket/8686 <p> 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: </p> <pre class="wiki">template &lt;class StateType,class EventType&gt; HandledEnum do_process_helper(EventType const&amp; evt, ::boost::mpl::false_ const &amp;, bool is_direct_call) try { return this-&gt;do_process_event(evt,is_direct_call); } catch (std::exception&amp; e) { // give a chance to the concrete state machine to handle this-&gt;exception_caught(evt,*this,e); } //... } </pre><p> gcc will somehow forget about the formal parameter <code>e</code> in the catch clause but still insists on the code in the <code>catch</code> clause to be compilable. Apart from replacing <code>try</code> and <code>catch</code> by the boost macros <code>BOOST_TRY</code> etc. I also had to declare a local variable <code>std::exception e</code> that won't be used in any way apart from making the code compilable in the case without exceptions. See the attached patch file. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8686 Trac 1.4.3 Norbert Riedlin <norbert.riedlin@…> Tue, 11 Jun 2013 11:26:34 GMT attachment set https://svn.boost.org/trac10/ticket/8686 https://svn.boost.org/trac10/ticket/8686 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">state_machine.patch</span> </li> </ul> Ticket Norbert Riedlin <norbert.riedlin@…> Tue, 11 Jun 2013 11:36:36 GMT <link>https://svn.boost.org/trac10/ticket/8686#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8686#comment:1</guid> <description> <p> Maybe it's obvious but I should mention that the function template is found in<br /> $BOOST_TRUNK$/boost/msm/back/state_machine.hpp </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Christophe Henry</dc:creator> <pubDate>Wed, 18 Sep 2013 19:45:55 GMT</pubDate> <title>status, version changed; resolution set https://svn.boost.org/trac10/ticket/8686#comment:2 https://svn.boost.org/trac10/ticket/8686#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost Development Trunk</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> 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. </p> Ticket