vtable Emission inconsistency

Miko Vich alexmudmiko@gmail.com
Thu Sep 3 18:55:00 GMT 2015


Hi,

[Note: This is an extremely stripped down case to show the issue]

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;
};


While this is a trivial problem to fix, it seems to me that the
behaviour is inconsistent.

Bug? Expected/undefined behaviour? Fixed in a later release?

Thanks.

--Mike



More information about the Gcc-help mailing list