[Bug c++/17335] rethrowing exceptions and capturing by reference

staube at t2 dot technion dot ac dot il gcc-bugzilla@gcc.gnu.org
Mon Sep 6 22:13:00 GMT 2004


------- Additional Comments From staube at t2 dot technion dot ac dot il  2004-09-06 22:13 -------
I have thinked about an additional problem of using the copy constructor for
rethrowing (i have just thought about it).

If you use the copy constructor for the base class then you will never be able
to recatch the exception with a catch for the derived class.
In general using the copy constructor of the base class means object-slicing
just as if the exception was catched by value and not by reference.

Thanks again
Marcelo

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17335



More information about the Gcc-bugs mailing list