Opened 15 years ago

Closed 15 years ago

#1198 closed Bugs (fixed)

patch: boost/function/function_template.hpp fails to compile with gcc -fno-exceptions

Reported by: andyc@… Owned by: Douglas Gregor
Milestone: To Be Determined Component: function
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

.... despite the fact that I've got BOOST_NO_EXCEPTIONS defined. Here's the error message:

.../boost/function/function_template.hpp:597: error: exception handling disabled, use -fexceptions to enable

The following patch fixes it but I'm not sure the #else part is correct:

===== 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->clear();
+#ifndef BOOST_NO_EXCEPTIONS
       try {
         this->assign_to_own(f);
       } catch (...) {
         vtable = 0;
         throw;
       }
+#else
+      this->assign_to_own(f);
+#endif
       return *this;
     }
 

Change History (3)

comment:1 by Marshall Clow, 15 years ago

Component: Nonefunction
Owner: set to Douglas Gregor

comment:2 by pierrejules.tremblay@…, 15 years ago

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.

comment:3 by Douglas Gregor, 15 years ago

Resolution: fixed
Status: newclosed

(In [39061]) Handle GCC's -fno-exceptions properly. Fixes #1198

Note: See TracTickets for help on using tickets.