This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16514] no warning of non-virtual dtor in subclass
- From: "gdr at acm dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2004 11:53:11 -0000
- Subject: [Bug c++/16514] no warning of non-virtual dtor in subclass
- References: <20040713102009.16514.naiman@math.jct.ac.il>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at acm dot org 2004-07-13 11:53 -------
Subject: Re: New: no warning of non-virtual dtor in subclass
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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16514