[Bug c++/67453] New: vtable not emitted for class with no key method and defaulted destructor with attribute((used))

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 4 15:22:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67453

            Bug ID: 67453
           Summary: vtable not emitted for class with no key method and
                    defaulted destructor with attribute((used))
           Product: gcc
           Version: 4.9.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

>From https://gcc.gnu.org/ml/gcc-help/2015-09/msg00015.html

The following class when compiled with g++ 4.9.2 emits the vtable for class
Foo:

class Foo
{

  virtual void dosomething() { }
  virtual ~Foo() noexcept __attribute__((used)) { }
};

The following class when compiled does not emit the vtable:

class Foo
{

  virtual void dosomething() { }
  virtual ~Foo() noexcept __attribute__((used)) = default;
};



More information about the Gcc-bugs mailing list