Date: Tue, 9 Nov 2021 18:12:19 +0100
On 09/11/2021 16.49, Yongwei Wu via Std-Discussion wrote:
> On Tue, 9 Nov 2021 at 23:04, <language.lawyer_at_[hidden] <mailto:language.lawyer_at_[hidden]>> wrote:
>
> On 09/11/2021 17:15, Yongwei Wu wrote:
> > On Tue, 9 Nov 2021 at 00:11, <language.lawyer_at_[hidden] <mailto:language.lawyer_at_[hidden]>> 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.
Jens
> On Tue, 9 Nov 2021 at 23:04, <language.lawyer_at_[hidden] <mailto:language.lawyer_at_[hidden]>> wrote:
>
> On 09/11/2021 17:15, Yongwei Wu wrote:
> > On Tue, 9 Nov 2021 at 00:11, <language.lawyer_at_[hidden] <mailto:language.lawyer_at_[hidden]>> 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.
Jens
Received on 2021-11-09 11:12:24