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


2381. Composite pointer type of pointers to plain and noexcept member functions

Section:7.2.2  [expr.type]    Status:CD5    Submitter:Mike Miller    Date:2018-06-19

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

According to 7.3.14 [conv.fctptr] paragraph 1,

A prvalue of type “pointer to member of typenoexceptfunction” can be converted to a prvalue of type“pointer to member of type function”. The resultdesignates the member function.

However, 7.2.2 [expr.type] paragraph 4 does notallow for this conversion in determining the compositepointer type of two pointers to member functions. Thecorresponding conversion is considered for pointers tonon-member functions, but only qualification conversions areconsidered for pointers to members:

Thecomposite pointer type of twooperandsp1 andp2 havingtypesT1 andT2, respectively, where atleast one is a pointer or pointer-to-member typeorstd::nullptr_t, is:

Note also that the places that refer to “compositepointer type” only refer to 7.3.13 [conv.mem]for conversions involving pointers to members, omitting anyreference to 7.3.14 [conv.fctptr] for pointers tomember functions. This affects 7.6.9 [expr.rel],7.6.10 [expr.eq], and 7.6.16 [expr.cond].

Proposed resolution (February, 2019):

  1. Change 7.2.2 [expr.type] paragraph 4 as follows:

  2. Thecomposite pointer type of twooperandsp1 andp2 havingtypesT1 andT2, respectively, where atleast one is a pointer or pointer-to-member typeorstd::nullptr_t, is:

  3. Change 7.6.10 [expr.eq] paragraph 4 as follows:

  4. If at least one of the operands is a pointer to member,pointer-to-member conversions (7.3.13 [conv.mem]),function pointer conversions (7.3.14 [conv.fctptr]),and qualification conversions (7.3.6 [conv.qual])are performed on both operands to bring them to theircomposite pointer type (7.2 [expr.prop]).Comparing...
  5. Change 7.6.16 [expr.cond] bullet 7.4 as follows:

  6. Lvalue-to-rvalue (7.3.2 [conv.lval]),array-to-pointer (7.3.3 [conv.array]), andfunction-to-pointer (7.3.4 [conv.func]) standardconversions are performed on the second and thirdoperands. After those conversions, one of the followingshall hold:




[8]ページ先頭

©2009-2026 Movatter.jp