Date: Thu, 11 Nov 2021 20:58:27 +0800
On Wed, 10 Nov 2021 at 01:58, Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
>
> On 09/11/2021 18.31, Yongwei Wu wrote:
> > On Wed, 10 Nov 2021 at 01:12, Jens Maurer <Jens.Maurer_at_[hidden] <mailto:Jens.Maurer_at_[hidden]>> wrote:
> >
> > On 09/11/2021 16.49, Yongwei Wu via Std-Discussion 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?
>
> At this point, none, which is a defect in the standard.
In that case: Is it fixed or tracked? If neither is true, should I
file a bug report (where)?
>
> On 09/11/2021 18.31, Yongwei Wu wrote:
> > On Wed, 10 Nov 2021 at 01:12, Jens Maurer <Jens.Maurer_at_[hidden] <mailto:Jens.Maurer_at_[hidden]>> wrote:
> >
> > On 09/11/2021 16.49, Yongwei Wu via Std-Discussion 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?
>
> At this point, none, which is a defect in the standard.
In that case: Is it fixed or tracked? If neither is true, should I
file a bug report (where)?
Received on 2021-11-11 06:58:22