diff -r gcc-4.5.0/gcc/cp/cp-tree.h ../gcc-4.5.0//gcc/cp/cp-tree.h
780a781,782
>     CPTI_COPY_CONSTRUCTOR_TYPE,
> 
879a882,884
> 
> /* The type of a copy constructor.  */
> #define copy_constructor_type			cp_global_trees[CPTI_COPY_CONSTRUCTOR_TYPE]
diff -r gcc-4.5.0/gcc/cp/except.c ../gcc-4.5.0//gcc/cp/except.c
664a665,667
>       tree all_constructors;
>       tree copy_constructor;
>       tree object_size;
679c682,692
<       fn = get_identifier ("__cxa_throw");
---
>       /* The COPY_CONSTRUCTOR_TYPE is the internal type of a copy constructor.  */
>       if (!copy_constructor_type)
> 	{
> 	  tmp = void_list_node;
> 	  tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
> 	  tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
> 	  tmp = build_function_type (void_type_node, tmp);
> 	  copy_constructor_type = build_pointer_type (tmp);
> 	}
> 
>       fn = get_identifier ("__cxa_throw_copyable");
682c695
< 	  /* Declare void __cxa_throw (void*, void*, void (*)(void*)).  */
---
> 	  /* Declare void __cxa_throw_copyable (void*, void*, void (*)(void*),size_t,void(*)(void*,void*)).  */
684a698,699
> 	  tmp = tree_cons (NULL_TREE, copy_constructor_type, tmp);
> 	  tmp = tree_cons (NULL_TREE, size_type_node, tmp);
827c842,899
<       tmp = tree_cons (NULL_TREE, cleanup, NULL_TREE);
---
>       if(!CLASS_TYPE_P(TREE_TYPE(object)))
>       {
>           object_size = cxx_sizeof(TREE_TYPE(object));
>           copy_constructor = build_int_cst (copy_constructor_type, 0);
>       }
>       else if(TYPE_HAS_INIT_REF(TREE_TYPE(object)))
>       {
>           if (TYPE_HAS_COMPLEX_INIT_REF (TREE_TYPE (object)))
>           {
>               tree fn;
>               
>               all_constructors = lookup_fnfields (TREE_TYPE (object),complete_ctor_identifier, 1);
>               all_constructors = BASELINK_FUNCTIONS (all_constructors);
> 
>               copy_constructor=error_mark_node;
> 
>               for (fn = all_constructors; fn; fn = OVL_NEXT (fn))
>               {
>                   tree t = OVL_CURRENT (fn);
>                   if(DECL_COPY_CONSTRUCTOR_P(t))
>                   {
>                       copy_constructor=t;
>                       break;
>                   }
>               }
> 
>               if(copy_constructor!=error_mark_node)
>               {
>                   mark_used (copy_constructor);
>                   cxx_mark_addressable (copy_constructor);
>                   /* Pretend it's a normal function.  */
>                   copy_constructor = build1 (ADDR_EXPR, copy_constructor_type, copy_constructor);
>                   object_size = cxx_sizeof(TREE_TYPE(object));
>               }
>               else
>               {
>                   object_size = build_int_cst (size_type_node, 0);
>                   copy_constructor = build_int_cst (copy_constructor_type, 0);
>               }
>           }
>           else
>           {
>               object_size = cxx_sizeof(TREE_TYPE(object));
>               copy_constructor = build_int_cst (copy_constructor_type, 0);
>           }
>           
>       }
>       else
>       {
> 	object_size = build_int_cst (size_type_node, 0);
>         copy_constructor = build_int_cst (copy_constructor_type, 0);
>       }
>       
> 
> 
>       tmp = tree_cons (NULL_TREE, copy_constructor, NULL_TREE);
>       tmp = tree_cons (NULL_TREE, object_size, tmp);
>       tmp = tree_cons (NULL_TREE, cleanup, tmp);
diff -r gcc-4.5.0/libstdc++-v3/libsupc++/eh_ptr.cc ../gcc-4.5.0//libstdc++-v3/libsupc++/eh_ptr.cc
33a34
> #include <string.h>
86a88
> 
146a149,162
> namespace
> {
>     std::exception_ptr bad_exception_ptr()
>     {
>       try
>       {
>           throw std::bad_exception();
>       }
>       catch(...)
>       {
>           return std::current_exception();
>       }
>     }
> }
161,190c177,216
<   return std::exception_ptr(
<     __get_object_from_ambiguous_exception (header));
< }
< 
< 
< static void
< __gxx_dependent_exception_cleanup(_Unwind_Reason_Code code,
< 				  _Unwind_Exception *exc)
< {
<   // This cleanup is set only for dependents.
<   __cxa_dependent_exception *dep = __get_dependent_exception_from_ue (exc);
<   __cxa_refcounted_exception *header =
<     __get_refcounted_exception_header_from_obj (dep->primaryException);
< 
<   // We only want to be called through _Unwind_DeleteException.
<   // _Unwind_DeleteException in the HP-UX IA64 libunwind library
<   // returns _URC_NO_REASON and not _URC_FOREIGN_EXCEPTION_CAUGHT
<   // like the GCC _Unwind_DeleteException function does.
<   if (code != _URC_FOREIGN_EXCEPTION_CAUGHT && code != _URC_NO_REASON)
<     __terminate (header->exc.terminateHandler);
< 
<   __cxa_free_dependent_exception (dep);
< 
<   if (__sync_sub_and_fetch (&header->referenceCount, 1) == 0)
<     {
<       if (header->exc.exceptionDestructor)
< 	header->exc.exceptionDestructor (header + 1);
< 
<       __cxa_free_exception (header + 1);
<     }
---
>   void * const source_object=__get_object_from_ambiguous_exception (header);
>   __cxa_refcounted_exception *source_header
>     = __get_refcounted_exception_header_from_obj (source_object);
> 
>   if(!source_header->object_size)
>   {
>       return bad_exception_ptr();
>   }
> 
>   void* const new_exception=__cxa_allocate_exception(source_header->object_size);
> 
>   if(source_header->copy_constructor)
>   {
>       try
>       {
>           source_header->copy_constructor(new_exception,source_object);
>       }
>       catch(...)
>       {
>           return bad_exception_ptr();
>       }
>   }
>   else
>   {
>       memcpy(new_exception,source_object,source_header->object_size);
>   }
> 
>   __cxa_refcounted_exception *new_header
>     = __get_refcounted_exception_header_from_obj (new_exception);
>   new_header->referenceCount = 0;
>   new_header->copy_constructor=source_header->copy_constructor;
>   new_header->object_size=source_header->object_size;
>   new_header->exc.exceptionType = source_header->exc.exceptionType;
>   new_header->exc.exceptionDestructor = source_header->exc.exceptionDestructor;
>   new_header->exc.unexpectedHandler = __unexpected_handler;
>   new_header->exc.terminateHandler = __terminate_handler;
>   __GXX_INIT_PRIMARY_EXCEPTION_CLASS(new_header->exc.unwindHeader.exception_class);
>   new_header->exc.unwindHeader.exception_cleanup = source_header->exc.unwindHeader.exception_cleanup;
>   
>   return std::exception_ptr(new_exception);
193d218
< 
197,208c222,260
<   void *obj = ep._M_get();
<   __cxa_refcounted_exception *eh
<     = __get_refcounted_exception_header_from_obj (obj);
< 
<   __cxa_dependent_exception *dep = __cxa_allocate_dependent_exception ();
<   dep->primaryException = obj;
<   __sync_add_and_fetch (&eh->referenceCount, 1);
< 
<   dep->unexpectedHandler = __unexpected_handler;
<   dep->terminateHandler = __terminate_handler;
<   __GXX_INIT_DEPENDENT_EXCEPTION_CLASS(dep->unwindHeader.exception_class);
<   dep->unwindHeader.exception_cleanup = __gxx_dependent_exception_cleanup;
---
>   void *source_object = ep._M_get();
> 
>   __cxa_refcounted_exception *source_header
>     = __get_refcounted_exception_header_from_obj (source_object);
> 
>   if(!source_header->object_size)
>   {
>       throw std::bad_exception();
>   }
> 
>   void* const new_exception=__cxa_allocate_exception(source_header->object_size);
> 
>   if(source_header->copy_constructor)
>   {
>       try
>       {
>           source_header->copy_constructor(new_exception,source_object);
>       }
>       catch(...)
>       {
>           throw std::bad_exception();
>       }
>   }
>   else
>   {
>       memcpy(new_exception,source_object,source_header->object_size);
>   }
> 
>   __cxa_refcounted_exception *new_header
>     = __get_refcounted_exception_header_from_obj (new_exception);
>   new_header->referenceCount = 1;
>   new_header->copy_constructor=source_header->copy_constructor;
>   new_header->object_size=source_header->object_size;
>   new_header->exc.exceptionType = source_header->exc.exceptionType;
>   new_header->exc.exceptionDestructor = source_header->exc.exceptionDestructor;
>   new_header->exc.unexpectedHandler = __unexpected_handler;
>   new_header->exc.terminateHandler = __terminate_handler;
>   __GXX_INIT_PRIMARY_EXCEPTION_CLASS(new_header->exc.unwindHeader.exception_class);
>   new_header->exc.unwindHeader.exception_cleanup = source_header->exc.unwindHeader.exception_cleanup;
211c263
<   _Unwind_SjLj_RaiseException (&dep->unwindHeader);
---
>   _Unwind_SjLj_RaiseException (&new_header->exc.unwindHeader);
213c265
<   _Unwind_RaiseException (&dep->unwindHeader);
---
>   _Unwind_RaiseException (&new_header->exc.unwindHeader);
217c269
<   __cxa_begin_catch (&dep->unwindHeader);
---
>   __cxa_begin_catch (&new_header->exc.unwindHeader);
diff -r gcc-4.5.0/libstdc++-v3/libsupc++/eh_throw.cc ../gcc-4.5.0//libstdc++-v3/libsupc++/eh_throw.cc
67a68,98
>   header->copy_constructor=0;
>   header->object_size=0;
>   header->exc.exceptionType = tinfo;
>   header->exc.exceptionDestructor = dest;
>   header->exc.unexpectedHandler = __unexpected_handler;
>   header->exc.terminateHandler = __terminate_handler;
>   __GXX_INIT_PRIMARY_EXCEPTION_CLASS(header->exc.unwindHeader.exception_class);
>   header->exc.unwindHeader.exception_cleanup = __gxx_exception_cleanup;
> 
> #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
>   _Unwind_SjLj_RaiseException (&header->exc.unwindHeader);
> #else
>   _Unwind_RaiseException (&header->exc.unwindHeader);
> #endif
> 
>   // Some sort of unwinding error.  Note that terminate is a handler.
>   __cxa_begin_catch (&header->exc.unwindHeader);
>   std::terminate ();
> }
> 
> extern "C" void
> __cxxabiv1::__cxa_throw_copyable (
>     void *obj, std::type_info *tinfo, 
>     void (*dest) (void *),size_t object_size,void (*copy_constructor)(void*,void*))
> {
>   // Definitely a primary.
>   __cxa_refcounted_exception *header
>     = __get_refcounted_exception_header_from_obj (obj);
>   header->referenceCount = 1;
>   header->copy_constructor=copy_constructor;
>   header->object_size=object_size;
diff -r gcc-4.5.0/libstdc++-v3/libsupc++/unwind-cxx.h ../gcc-4.5.0//libstdc++-v3/libsupc++/unwind-cxx.h
88a89,90
>     void (*copy_constructor)(void* dest,void* source);
>     size_t object_size;
172a175,180
> 
> extern "C" void
> __cxa_throw_copyable (
>     void *obj, std::type_info *tinfo, 
>     void (*dest) (void *),size_t object_size,void (*copy_constructor)(void*,void*))
>     __attribute__((noreturn));
