This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warning on C++ catch by value on non primitive types
- From: Mike Stump <mrs at apple dot com>
- To: Thomas Costa <tcosta at ovro dot caltech dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 12 Oct 2005 17:46:01 -0700
- Subject: Re: Warning on C++ catch by value on non primitive types
- References: <2C436B30-964F-4559-9461-0F9FA9B9ADE0@ovro.caltech.edu> <8763E89D-F5B2-4CCE-89A6-705C33794B45@ovro.caltech.edu>
On Oct 12, 2005, at 2:20 PM, Thomas Costa wrote:
gcc doesn't have such a warning at present.
Yup.
Is this correct?
I suspect so.
What are the chances of adding such a warning?
Zero, unless someone else wants it or you file a bug report asking
for the enhancement. Be sure to explain why it is a good idea,
otherwise the chances of it happening could drop to zero.
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?
Sure.
Look at the parser (gcc/cp/parser.c:cp_parser_handler) and set a
break point there, follow it down into semantic processing, pick a
nice place to do the checking, and then add the code to check it.
For it to be accepted, others would have to agree it is a good thing
to have, for example, if it were in the Effective C++ book, you can
argue that way.