This is the mail archive of the
mailing list for the GCC project.
Re: V3 patch causes EH failures in ILP32 mode
On Wed, 23 Jun 2004 12:41:59 -0700, Mark Mitchell <firstname.lastname@example.org> said:
> When I worked on an error-checking tool that had a -Weffc++-like
> feature (and said tool was actually endorsed by Scott Meyers, no
> less), we tried to figure out whether or not dynamic memory really
> was involved using various heuristics. For example, "does the
> constructor call "new" and assign that to a data member?"
> The -Weffc++ implementation in G++ is not as sophisticated.
Maybe one first step would be to only warn about a nonexistent copy
constructor if the class has both a raw pointer member _and_ a
destructor. (Or (raw pointer && (destructor || assignment)),
perhaps.) And similarly for assignment. It should at least reduce
the false positive rate, and I would imagine (knowing nothing at all
about the relevant bits of GCC) that it would be easier to implement
than heuristics involving looking at the actual definitions of various