Movatterモバイル変換


[0]ホーム

URL:


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

2025-12-20


2353. Potential results of a member access expression for a static data member

Section:6.3  [basic.def.odr]    Status:CD5    Submitter:Richard Smith    Date:2017-08-18

[Accepted as a DR at the February, 2019 meeting.]

According to 6.3 [basic.def.odr] bullet 2.3, the potentialresults of a member access expression are simply the object expression.This rule incorrectly handles an example like:

  struct X {    static const int n = 0;  };  X x = {};  int b = x.n;

BecauseX::n is not one of the potential results, theexpressionx.n odr-usesX::n, requiring it to bedefined.

Notes from the April, 2018 teleconference:

CWG agreed with the suggested direction to make the member apotential result in cases like the example.

Proposed resolution (February, 2019):

Change 6.3 [basic.def.odr] paragraph 2 as follows:

An expression is potentially evaluated unless it is anunevaluated operand (7.2 [expr.prop]) or asubexpression thereof. The set of potential results of anexpressione is defined as follows:




[8]ページ先頭

©2009-2026 Movatter.jp