Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-11-07


2614. Unspecified results for class member access

Section:7.6.1.5  [expr.ref]    Status:C++23    Submitter:Andrey Erokhin    Date:2021-10-27

[Accepted as a DR at the November, 2022 meeting.]

Subclause 7.6.1.5 [expr.ref] paragraph 6 specifies:

IfE2 is declared to have type “referencetoT”, thenE1.E2 is an lvalue; the typeofE1.E2 isT. Otherwise, ...

This does not specifiy which object or functiom the resultinglvalue designates. A similar problem exists with member enumerators:

IfE2 is a member enumerator and the type ofE2isT, the expressionE1.E2 is a prvalue. The typeofE1.E2 isT.

Proposed resolution (approved by CWG 2022-09-23):

  1. Split and change in 7.6.1.5 [expr.ref] paragraph 6 as follows:

    IfE2 is declared to have type “referencetoT”, thenE1.E2 is an lvalue; theof typeofE1.E2 isT.IfE2 is astatic data member,E1.E2 designates the object or functionto which the reference is bound, otherwiseE1.E2 designatesthe object or function to which the corresponding reference memberofE1 is bound.

    Otherwise, ...

  2. Change in 7.6.1.5 [expr.ref] bullet 6.5 as follows:

    IfE2 is a member enumerator and the type ofE2isT, the expressionE1.E2 is aprvalue. Theof typeofE1.E2isTwhose value is the value of theenumerator.



[8]ページ先頭

©2009-2025 Movatter.jp