- Title
- Pointer to member of nested anonymous union
- Status
- cd4
- Section
- 7.6.2.2 [expr.unary.op]
- Submitter
- Richard Smith
Created on 2013-10-22.00:00:00 last changed 116 months ago
Messages
Date: 2014-11-15.00:00:00
[Moved to DR at the November, 2014 meeting.]
Date: 2014-02-15.00:00:00
Proposed resolution (February, 2014): Change 7.6.2.2 [expr.unary.op] paragraph 3 as follows:
The result of the unary & operator is a pointer to its
operand. The operand shall be an lvalue or a qualified-id. If the
operand is a qualified-id naming a non-static or variant
member m of some class C with type T , the result
has type “pointer to member of class C of type
T ” and is a prvalue designating C::m . Otherwise...
Date: 2026-07-25.21:52:10
According to 7.6.2.2 [expr.unary.op] paragraph 3, It is not clear whether this wording applies to variant
members of C (i.e., members of nested anonymous
unions) or only to its non-variant members. For example,
given should the type of x be int A::* or
int A:: anon ::* ? Current implementations
choose the former.
The result of the unary & operator is a pointer
to its operand. The operand shall be an lvalue or
a qualified-id. If the operand is
a qualified-id naming a non-static member m
of some class C with type T , the result
has type “pointer to member of class C of type
T ” and is a prvalue designating C::m .
struct A { union { int n; }; };
auto x = &A::n;
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
| 2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
| 2015-04-13 00:00:00 | admin | set | messages: + msg5342 |
| 2014-11-24 00:00:00 | admin | set | status: ready -> dr |
| 2014-03-03 00:00:00 | admin | set | messages: + msg4808 |
| 2014-03-03 00:00:00 | admin | set | status: open -> ready |
| 2013-10-22 00:00:00 | admin | create | |