This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55836] Weffc++: warning: base class 'class std::list<int, std::allocator<int> >' has a non-virtual destructor
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Jan 2013 00:09:23 +0000
- Subject: [Bug c++/55836] Weffc++: warning: base class 'class std::list<int, std::allocator<int> >' has a non-virtual destructor
- Auto-submitted: auto-generated
- References: <bug-55836-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55836
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-01 00:09:23 UTC ---
(In reply to comment #0)
> Created attachment 29066 [details]
> 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.
Why not just not use -Weffc++ for STL. effc++ warnings are written from a book
and they don't always make sense really.
> If the compiler were to set a pre-processor variable when -Weffc++ is in
> effect, adding virtual destructors could be made conditional.
Then it would violate the one definition rule.