Movatterモバイル変換


[0]ホーム

URL:


Issue 1800 - WG21 CWG Issues
Title
Pointer to member of nested anonymous union
Status
cd4
Section
7.6.2.2 [expr.unary.op]
Submitter
Richard Smith

Created on2013-10-22.00:00:00 last changed107 months ago

Messages

msg5342 (view)
Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

msg4808 (view)
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 itsoperand. The operand shall be an lvalue or aqualified-id. If theoperand is aqualified-id naming a non-staticor variantmemberm of some classC with typeT, the resulthas type “pointer to member of classC of typeT” and is a prvalue designatingC::m. Otherwise...
msg4759 (view)
Date: 2013-10-22.00:00:00

According to 7.6.2.2 [expr.unary.op] paragraph 3,

The result of the unary& operator is a pointerto its operand. The operand shall be an lvalue oraqualified-id. If the operand isaqualified-id naming a non-static membermof some classC with typeT, the resulthas type “pointer to member of classC of typeT” and is a prvalue designatingC::m.

It is not clear whether this wording applies to variantmembers ofC (i.e., members of nested anonymousunions) or only to its non-variant members. For example,given

  struct A { union { int n; }; };  auto x = &A::n;

should the type ofx beint A::* orint A::anon::*? Current implementationschoose the former.

History
DateUserActionArgs
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: +msg5342
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: +msg4808
2014-03-03 00:00:00adminsetstatus: open -> ready
2013-10-22 00:00:00admincreate

[8]ページ先頭

©2009-2025 Movatter.jp