[PATCHv2] do not throw in std::make_exception_ptr

Gleb Natapov gleb@scylladb.com
Fri Oct 21 11:37:00 GMT 2016


On Thu, Oct 20, 2016 at 11:53:49PM -0400, Ryan Burn wrote:
> Are exception classes required to support emplace new construction
> like that? With this change, Intel's TBB library no longer compiles
> because its exception class declares it's own new operator (see
> https://github.com/wjakob/tbb/blob/master/include/tbb/tbb_exception.h):
> 
Can you test this patch please:


diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index 21e4e8b..6ade626 100644
--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -190,7 +190,7 @@ namespace std
           (void)__cxxabiv1::__cxa_init_primary_exception(__e,
                                            const_cast<std::type_info*>(&typeid(__ex)),
                                            __exception_ptr::__dest_thunk<_Ex>);
-          new (__e) _Ex(__ex);
+          ::new (__e) _Ex(__ex);
           return exception_ptr(__e);
 #else
           throw __ex;
> 
> class tbb_exception : public std::exception
> {
>     /** No operator new is provided because the TBB usage model assumes dynamic
>          creation of the TBB exception objects only by means of applying move()
>          operation on an exception thrown out of TBB scheduler. **/
>     void* operator new ( size_t );
> ....
> 
> 
> On Mon, Aug 22, 2016 at 1:29 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
> > On 21/08/16 15:20 +0300, Gleb Natapov wrote:
> >>
> >> Jonathan,
> >>
> >> Is this version OK with you?
> >
> >
> > I've committed the attached version, which just adds some whitespace
> > and fixes the testsuite_abi.cc test.
> >
> > Thanks very much for the improvement to the code.
> >

--
			Gleb.



More information about the Gcc-patches mailing list