This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/16514] New: no warning of non-virtual dtor in subclass
- From: "Gabriel Dos Reis" <gdr at acm dot org>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Jul 2004 13:52:54 +0200 (CEST)
- Subject: Re: [Bug c++/16514] New: no warning of non-virtual dtor in subclass
- References: <20040713102009.16514.naiman@math.jct.ac.il>
- Reply-to: gdr at acm dot org
naiman at math dot jct dot ac dot il:
> Dear G++ Folk,
>
> An astute student found the following example:
>
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> class foo1 {
> public:
> virtual void f1 (void) {}
> virtual ~foo1 (void);
> };
>
> class foo2 : public foo1 {
> public:
> ~foo2 (void);
> };
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> We believe the compiler should at least warn that foo2
> has a virtual function, and non-virtual dtor.
You're mistaken: foo2 has a virtual destructor.
The PR is invalid.