Boost C++ Libraries: Ticket #1198: patch: boost/function/function_template.hpp fails to compile with gcc -fno-exceptions https://svn.boost.org/trac10/ticket/1198 <p> .... despite the fact that I've got BOOST_NO_EXCEPTIONS defined. Here's the error message: </p> <pre class="wiki">.../boost/function/function_template.hpp:597: error: exception handling disabled, use -fexceptions to enable </pre><p> The following patch fixes it but I'm not sure the #else part is correct: </p> <pre class="wiki">===== boost/function/function_template.hpp 1.1 vs edited ===== --- 1.1/boost/function/function_template.hpp 2007-08-17 11:57:51 +01:00 +++ edited/boost/function/function_template.hpp 2007-08-22 13:55:32 +01:00 @@ -592,12 +592,16 @@ return *this; this-&gt;clear(); +#ifndef BOOST_NO_EXCEPTIONS try { this-&gt;assign_to_own(f); } catch (...) { vtable = 0; throw; } +#else + this-&gt;assign_to_own(f); +#endif return *this; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1198 Trac 1.4.3 Marshall Clow Thu, 23 Aug 2007 14:02:52 GMT component changed; owner set https://svn.boost.org/trac10/ticket/1198#comment:1 https://svn.boost.org/trac10/ticket/1198#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Douglas Gregor</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">function</span> </li> </ul> Ticket pierrejules.tremblay@… Tue, 28 Aug 2007 18:33:10 GMT <link>https://svn.boost.org/trac10/ticket/1198#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1198#comment:2</guid> <description> <p> Actually, there are two try/catch blocks to wrap with an #ifdef BOOST_NO_EXCEPTIONS block: one at line 564, the other at line 595. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Wed, 29 Aug 2007 19:06:12 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1198#comment:3 https://svn.boost.org/trac10/ticket/1198#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/39061" title="Handle GCC's -fno-exceptions properly. Fixes #1198">[39061]</a>) Handle GCC's -fno-exceptions properly. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1198" title="#1198: Bugs: patch: boost/function/function_template.hpp fails to compile with gcc ... (closed: fixed)">#1198</a> </p> Ticket