On Wed, 10 Nov 2021 at 01:12, Jens Maurer <Jens.Maurer@gmx.net> wrote:
On 09/11/2021 16.49, Yongwei Wu via Std-Discussion wrote:
> On Tue, 9 Nov 2021 at 23:04, <language.lawyer@gmail.com <mailto:language.lawyer@gmail.com>> wrote:
>
>     On 09/11/2021 17:15, Yongwei Wu wrote:
>     > On Tue, 9 Nov 2021 at 00:11, <language.lawyer@gmail.com <mailto:language.lawyer@gmail.com>> wrote:
>     >
>     >> On 08/11/2021 15:32, Yongwei Wu wrote:

>     >>> struct B1 { int i1; };
>     >>> struct B2 { int i2; };
>     >>> struct B3 { int i3; };
>     >>>
>     >>> struct D : B1, B2 {};
>     >>>
>     >>> D* pD = …;
>     >>> B2* pB2 = …;
>     >>> B3* pB3 = …;
>     >>>

> Do you know for sure whether modifying *pD by *pB3 is undefined behaviour or not NOW?

struct B3 is totally unrelated to struct D.  It is intended that
you can't use the B3 type to inspect or change anything on a
D object.

I think so too. But which rule forbids that?