Date: Mon, 9 May 2022 13:10:21 -0400
Assuming that I understand you correctly, that's the way it has been in
C++ for anonymous unions since 1982 or so.
On 5/9/2022 12:26 PM, Joseph Myers via Liaison wrote:
> On Sat, 7 May 2022, Aaron Ballman via Liaison wrote:
>
>> I think we're mostly on the same page, but I want to be sure I'm
>> clear: the members of the anonymous union don't change type, it's the
>> member access expression that starts to consider the anonymous field's
>> qualifiers. e.g.,
> Yes. I this fits in with the general principle that anonymous structs and
> unions just provide a shorthand for referring to members; they don't
> change semantics compared to corresponding code where those anonymous
> structs and unions are given names, nor do they allow anything not allowed
> when they are given names (cf. C11 DRs 499 and 502, both resolved in line
> with that principle).
>
C++ for anonymous unions since 1982 or so.
On 5/9/2022 12:26 PM, Joseph Myers via Liaison wrote:
> On Sat, 7 May 2022, Aaron Ballman via Liaison wrote:
>
>> I think we're mostly on the same page, but I want to be sure I'm
>> clear: the members of the anonymous union don't change type, it's the
>> member access expression that starts to consider the anonymous field's
>> qualifiers. e.g.,
> Yes. I this fits in with the general principle that anonymous structs and
> unions just provide a shorthand for referring to members; they don't
> change semantics compared to corresponding code where those anonymous
> structs and unions are given names, nor do they allow anything not allowed
> when they are given names (cf. C11 DRs 499 and 502, both resolved in line
> with that principle).
>
Received on 2022-05-09 17:10:22