public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58140] New: -Wnon-virtual-dtor shouldn't fire for classes declared final
@ 2013-08-12 17:48 tudorb at fb dot com
  2013-08-12 17:51 ` [Bug c++/58140] " tudorb at fb dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tudorb at fb dot com @ 2013-08-12 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58140
           Summary: -Wnon-virtual-dtor shouldn't fire for classes declared
                    final
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tudorb at fb dot com

Created attachment 30636
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30636&action=edit
Test case

In C++11, we can declare a class as "final" to indicate that it can't be
derived from. In that case, having a public non-virtual destructor is fine,
even if the class has virtual methods (no derived classes exist, so deleting an
instance via a pointer is always safe).

In the attached example, the warning should fire for NonFinalDerived, but not
for FinalDerived.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-07  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-12 17:48 [Bug c++/58140] New: -Wnon-virtual-dtor shouldn't fire for classes declared final tudorb at fb dot com
2013-08-12 17:51 ` [Bug c++/58140] " tudorb at fb dot com
2013-08-12 19:17 ` redi at gcc dot gnu.org
2013-08-12 19:22 ` redi at gcc dot gnu.org
2014-01-07  5:48 ` andrewjcg at gmail dot com
2014-01-07  9:46 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).