This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question w.r.t. `'class Foo' has virtual functions but non-virtualdestructor` warning.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Chris Lattner <sabre at nondot dot org>, Karel Gardas <kgardas at objectsecurity dot com>, Jonathan Wakely <cow at compsoc dot man dot ac dot uk>, gcc at gcc dot gnu dot org
- Date: 07 Mar 2005 06:55:50 +0100
- Subject: Re: Question w.r.t. `'class Foo' has virtual functions but non-virtualdestructor` warning.
- Organization: Integrable Solutions
- References: <Pine.LNX.4.61.0503041443080.22823@nondot.org><42290604.9090609@codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
[...]
| > It seems that the warning could be improved to be emitted when the
| > *delete* is seen of a class without a virtual dtor (but that does
| > have virtual methods). If you never actually do the questionable
| > behavior, you'd never get the warning. It seems like a bug to emit
| > it for the class definition.
|
| Age-old debate: better to warn early about possibly broken interfaces,
| or late about definitely broken usage? I think that warning early,
| together with what DJ is calling fine-grained warning control is the
| best solution.
When that is a nuisance, I don't see how it is best solution.
-- Gaby