[Bug c++/108216] Wrong offset for (already-constructed) virtual base during construction of full object

2022-12-23 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108216

--- Comment #3 from Thiago Macieira  ---
In bug 70644, the pointer to Base was passed to Base's constructor, so the
conversion from the derived type to the virtual base Base happened clearly
before said base was constructed.

In this example here, the conversion happens inside C's constructor body, where
C's direct (but virtual) base A must be fully initialised, notwithstanding the
fact that it was initialised by D's in-charge constructor.

I'm not making a conclusion that this is or isn't UB. I'm saying that it can't
be UB for the explanation offered in that bug.

[Bug c++/108216] Wrong offset for (already-constructed) virtual base during construction of full object

2022-12-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108216

--- Comment #2 from Andrew Pinski  ---
Right reading bug 70644, then this code might be undefined.

[Bug c++/108216] Wrong offset for (already-constructed) virtual base during construction of full object

2022-12-23 Thread arthur.j.odwyer at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108216

--- Comment #1 from Arthur O'Dwyer  ---
Possibly tangentially related: #70644, #81051