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

             Bug #: 55836
           Summary: Weffc++: warning: base class 'class std::list<int,
                    std::allocator<int> >' has a non-virtual destructor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ham...@sdu.se


Created attachment 29066
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29066
Self-contained source file

When using -Weffc++ with this code

    class Foo : public std::list<int> { };

the compiler warns that the base class "has a non-virtual destructor". While
this is true, there is not much one can do about it.

Suggestions: either remove the warning in these cases (when the problem is in
the standard library), or add virtual destructors to standard library classes.

If the compiler were to set a pre-processor variable when -Weffc++ is in
effect, adding virtual destructors could be made conditional.

/Lars Hamrén

Reply via email to