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

--- Comment #27 from Michi Henning <michi at triodia dot com> ---
My apologies for my incredibly late reply. (I just stumbled across this issue
again.) And my thanks to you for taking the time to analyse this!

I think your analysis is right. 3.8.5/3:

"- the pointer is implicitly converted to a pointer to a virtual base class"

So, this is UB. Really nasty, in the sense that

make_shared<T>(args) doesn't always do the same thing as shared_ptr<T>(new
T(args))

Seeing how subtle this is, a warning for the implicit conversion to pointer to
base would be supremely useful.

Reply via email to