]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix libstdc++ build with -fno-exceptions
authorJonathan Wakely <jwakely@redhat.com>
Mon, 18 Jan 2016 11:24:20 +0000 (11:24 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 18 Jan 2016 11:24:20 +0000 (11:24 +0000)
PR libstdc++/69340
* src/c++11/cow-stdexcept.cc (_txnal_cow_string_C1_for_exceptions):
Use macros for exception handling and fix unused parameter warning.

From-SVN: r232502

libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/cow-stdexcept.cc

index 48600ad7d6d9388eeeb2a3ab7548af477065da94..74ef4f61eab5290f3f3854fa194b3fa3356da7d9 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-18  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/69340
+       * src/c++11/cow-stdexcept.cc (_txnal_cow_string_C1_for_exceptions):
+       Use macros for exception handling and fix unused parameter warning.
+
 2016-01-17  John David Anglin  <danglin@gcc.gnu.org>
 
        PR libstdc++/68734
index e2d7e7614933afdfa262144e5bcbf9f41948c4ad..eddb36b48c4906fbf80eb922c4ce55164330f788 100644 (file)
@@ -232,7 +232,8 @@ void _ITM_addUserCommitAction(void (*)(void *), uint64_t, void *) { };
 // that also notifies the TM runtime about allocations belonging to this
 // exception.
 void
-_txnal_cow_string_C1_for_exceptions(void* that, const char* s, void *exc)
+_txnal_cow_string_C1_for_exceptions(void* that, const char* s,
+                                   void *exc __attribute__((unused)))
 {
   typedef std::basic_string<char> bs_type;
   bs_type *bs = (bs_type*) that;
@@ -249,17 +250,17 @@ _txnal_cow_string_C1_for_exceptions(void* that, const char* s, void *exc)
   // TODO Once this is supported, link the following allocation to this
   // exception: void *prev = _ITM_setAssociatedException(exc);
   bs_type::_Rep *rep;
-  try
+  __try
     {
       rep = (bs_type::_Rep*) _ZGTtnaX (len + sizeof (bs_type::_Rep));
     }
-  catch (...)
+  __catch (...)
     {
       // Pop the association with this exception.
       // TODO Once this is supported, link the following allocation to this
       // exception: _ITM_setAssociatedException(prev);
       // We do not need to instrument a rethrow.
-      throw;
+      __throw_exception_again;
     }
   // Pop the association with this exception.
   // TODO Once this is supported, link the following allocation to this