On 04/04/2014 01:04 PM, Nathan Sidwell wrote:
On 04/04/14 17:54, Markus Trippelsdorf wrote:

markus@x4 tmp % g++ -Wnon-virtual-dtor -std=c++11 -c test.ii
test.ii: In instantiation of ‘class A<>’:
test.ii:12:16:   required from here
test.ii:9:26: warning: base class ‘class opt_storage<0>’ has
accessible non-virtual destructor [-Wnon-virtual-dtor]
  template <int = 0> class A : Option, opt_storage<0>

ah, you've hit on the one case I was unsure about -- IMHO Scott's rule
about bases is incomplete.  The rule should be for publicly accessible
bases only -- opt_storage is private.

I also notice that the opt_storage destructor is implicitly declared and trivial; it seems excessive to warn in that case. I'm also somewhat skeptical about extending the warning to non-polymorphic bases at all, at least in the absence of -Weffc++.

Since this change is causing problems, I'm inclined to back it out until after 4.9 branches.

Jason

Reply via email to