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


1017. Member access transformation in unevaluated operands

Section:11.4.3  [class.mfct.non.static]    Status:C++11    Submitter:Johannes Schaub    Date:2009-12-30

[Voted into the WP at the March, 2011 meeting as part of paper N3282.]

The following innocuous-appearing code is currently ill-formed:

    struct A {        int a;    };    struct B {        void f() {            decltype(A::a) i;    // ill-formed        }    };

The reason is that, according to 11.4.3 [class.mfct.non.static] paragraph 3, the reference toA::a is transformed into(*this).A::a, and there is noA subobject ofB. It would seem reasonable to suppress this transformationin unevaluated operands, where a reference to a non-static memberis permitted without an object expression.

(See alsoissue 1005.)

Notes from the November, 2010 meeting:

The CWG agreed that the resolution ofissue 515was ill-advised and should be reversed.


[8]ページ先頭

©2009-2026 Movatter.jp