Open Quuxplusone opened 8 years ago
Bugzilla Link | PR28248 |
Status | NEW |
Importance | P normal |
Reported by | Reid Kleckner (rnk@google.com) |
Reported on | 2016-06-21 15:14:42 -0700 |
Last modified on | 2016-07-07 16:53:48 -0700 |
Version | unspecified |
Hardware | PC Windows NT |
CC | dblaikie@gmail.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I guess this only happens if you initialize B in a global, because then we initialize it statically. If you make a B on the stack or with 'new', then we emit B's ctor, which calls A's ctor, which references A's vtable, and we get class debug info.
Maybe this isn't that high priority then.
Weird that we bother with a ctor in the other cases - though the static
initialization is only /required/ in the global case... *shrug*
But, yes, this is a bug (across platforms, shows up on non-windows as well,
when building with C++11). GCC gets this right, though I'm not sure exactly
what rules it uses to do so. Perhaps they just rely on the ctor being inlined
away, so they start off by generating all the assorted things, and thus
emitting the debug info for the type.
Running some experiments. But I guess the most general way to fix this would be
to wire the "requires vtable" stuff through the static initialization
optimization codepath so it still triggers in a way that's sufficient to
generate the debug info even though we never actually emit the ctor, vtable,
etc.