boomanaiden154 wrote:

> You're correct to be conservative about virtual bases, because they will 
> generally still be live out of the base subobject destructor. I think it's 
> worth doing this for non-virtual bases just to avoid needing an excessive 
> number of controlling flags, since otherwise I assume people might want a 
> staging flag that disables this just for classes with bases.

Thanks for confirming. I've constructed https://godbolt.org/z/nKPfhPxsx which I 
believe demonstrates the problem there (we end up destroying `foobar` before 
`foo` or `bar` in the whole object destructor, so marking stores to `this` 
inside of `foobar` would change the behavior).

Given you said this is in general, it sounds like there are cases where virtual 
bases are not live out of the base subobject destructor?

https://github.com/llvm/llvm-project/pull/166276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to