Warning on C++ catch by value on non primitive types

Thomas Costa tcosta@ovro.caltech.edu
Wed Oct 12 21:37:00 GMT 2005


I posted this on the gcc-help list but I haven't received any replies  
so I thought that might mean that I hadn't missed anything obvious  
and gcc doesn't have such a warning at present.
Is this correct?
What are the chances of adding such a warning?
Is it basic enough to add to the 3.4.x and/or 4.x C++ front end that  
I could help with the task?


> From: Thomas Costa <tcosta@ovro.caltech.edu>
> Date: 10 October 2005 3:34:46 PM PDT
> To: gcc-help@gcc.gnu.org
> Subject: Warning on C++ catch by value on non primitive types
>
>
> Is there any way to get gcc/g++ to warn on C++ code that does a  
> catch by value of non primitive types (i.e. types that aren't int,  
> float, bool, etc.)?
>
> I would take a warning on any catch by value but the ideal would be  
> a warning that doesn't fire for "catch (const int x)"
>
> This continually creeps into our our C++ code base.
>
>
>



More information about the Gcc mailing list