C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] cv-qualified anonymous types and member access expressions

From: Joseph Myers <joseph_at_[hidden]>
Date: Mon, 9 May 2022 16:26:18 +0000
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).

-- 
Joseph S. Myers
joseph_at_[hidden]

Received on 2022-05-09 16:26:24