On 3 September 2015 at 19:55, Miko Vich wrote: > 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? This is a bug, present in all releases. Jason (the C++ front-end maintainer) says: "looks like a bug. specifically, we aren't handling attribute used properly for the defaulted dtor" I've created https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67453 -- thanks for letting us know about it.