public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42983]  New: [c++0x] Unvirtualzation of virtual destructor
@ 2010-02-06  7:58 lavock at gmail dot com
  2010-02-06 10:15 ` [Bug c++/42983] [c++0x] Unvirtualization " paolo dot carlini at oracle dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: lavock at gmail dot com @ 2010-02-06  7:58 UTC (permalink / raw)
  To: gcc-bugs

Hello,
The way to declare a inline virtual destructor within the class declaration
seems to unvirtualize it.
Trying the following code :

#include <iostream>

struct A {
  virtual ~A() = default;
};

struct B : A {
  virtual ~B() {
    std::cout << "B destructor" << std::endl;
  }
};

int main() {
  B* b = new B;
  A * ptrA = *b;
  delete ptrA;
  return 0;
}

Nothing appear on standard output.


-- 
           Summary: [c++0x] Unvirtualzation of virtual destructor
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lavock at gmail dot com
 GCC build triplet: -486-linux-gnu
  GCC host triplet: -486-linux-gnu
GCC target triplet: -i486-linux-gnu


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


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

end of thread, other threads:[~2010-02-17  0:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-06  7:58 [Bug c++/42983] New: [c++0x] Unvirtualzation of virtual destructor lavock at gmail dot com
2010-02-06 10:15 ` [Bug c++/42983] [c++0x] Unvirtualization " paolo dot carlini at oracle dot com
2010-02-06 12:05 ` lavock at gmail dot com
2010-02-06 20:15 ` [Bug c++/42983] [C++0x] Defaulted virtual destructor isn't virtual paolo dot carlini at oracle dot com
2010-02-07 11:44 ` paolo dot carlini at oracle dot com
2010-02-08 12:35 ` jwakely dot gcc at gmail dot com
2010-02-08 12:57 ` paolo dot carlini at oracle dot com
2010-02-08 13:49 ` lavock at gmail dot com
2010-02-08 13:56 ` jwakely dot gcc at gmail dot com
2010-02-08 13:58 ` albrt2000 at gmail dot com
2010-02-08 14:00 ` jwakely dot gcc at gmail dot com
2010-02-08 14:05 ` jwakely dot gcc at gmail dot com
2010-02-08 14:24 ` albrt2000 at gmail dot com
2010-02-08 14:25 ` albrt2000 at gmail dot com
2010-02-08 14:36 ` paolo dot carlini at oracle dot com
2010-02-08 14:49 ` albrt2000 at gmail dot com
2010-02-08 15:10 ` jwakely dot gcc at gmail dot com
2010-02-08 15:18 ` lavock at gmail dot com
2010-02-08 15:28 ` paolo dot carlini at oracle dot com
2010-02-10 21:49 ` jason at gcc dot gnu dot org
2010-02-10 22:00 ` jason at gcc dot gnu dot org
2010-02-17  0:22 ` paolo dot carlini at oracle dot com

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).