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: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Cc: tcosta at ovro dot caltech dot edu
- Date: Thu, 13 Oct 2005 09:41:22 -0500
- Subject: Re: Warning on C++ catch by value on non primitive types
> yeah, if it were in one of those books it could be added to the -weff-c+
> + option. It doesn't seem sensible to add a different option for an
> alternative (set of?) coding rule(s).
FYI this is item 13 in MEC++.
I think this would be a good error to have. My suggestion is to file an
enhancement request in gcc bugzilla, with this code:
#include <stdexcept>
void
foo()
{
try
{
}
catch (std::logic_error e)
{
}
}
saying that with -Weffc++, you want a warning. Include a link back to
this thread, so that who-ever works on this can read the initial
reaction and the suggestion by Nathan to hook into finish_handler_parms.
In the near past, Giovanni has done a good job of enhancing the More
Effective C++ rules. If you ask nicely, maybe he'd do the same for this.
best,
benjamin