This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Effective c++ member initialization list spurious warning?
On 11/7/07, Miles Bader <miles.bader@necel.com> wrote:
> [1] This is a _good idea_ in many cases, but may not make much sense
> when there are no other virtual methods and no data members in the
> derived class, and the resulting addition of a vtable pointer and
> overhead of calling a virtual destructor is often unacceptable.
>
Yes in this case is it possible for gcc to know that that a virtual
destructor warning is not needed?
struct A{ A(); ~A(); };
struct B: private A {B();~B();};
int main(){}
$ g++ -Weffc++ t.c
t.c:2: warning: base class `struct A' has a non-virtual destructor
Regards,
JT