[Bug c++/16168] -Weffc++ item 14 improvements

gdr at acm dot org gcc-bugzilla@gcc.gnu.org
Mon Jun 28 20:14:00 GMT 2004


------- Additional Comments From gdr at acm dot org  2004-06-28 20:14 -------
Subject: Re:  -Weffc++ item 14 improvements

You Wrote bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org  2004-06-28
> 19:29 -------
> Here's a testcase:
> ------------
> struct A {
>     ~A ();
> };
>
> struct B : public A {};
> ------------
> g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc
> x.cc:5: warning: base class `struct A' has a non-virtual destructor
>
> I'm not really sure whether we want to avoid the error message here,

It does not make much sense in the context of modern C++.  In
particular, you get that noise each time you derive from
std::iterator<> or std::unary_function<> or such.

> but I guess it makes sense if there are no virtual functions.
No, it does not.  See above.  Even when there are virtual
functions, it is pretty useless when emitted unconditionally.

We had this discussion in the PR filled by Nathan Myers.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168



More information about the Gcc-bugs mailing list