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


1512. Pointer comparison vs qualification conversions

Section:7.6.9  [expr.rel]    Status:CD3    Submitter:Steve Clamage    Date:2012-06-22

[Moved to DR status at the April, 2013 meeting as paper N3624.]

According to 7.6.9 [expr.rel] paragraph 2, describingpointer comparisons,

Pointer conversions (7.3.12 [conv.ptr]) and qualificationconversions (7.3.6 [conv.qual]) are performed on pointeroperands (or on a pointer operand and a null pointer constant, or ontwo null pointer constants, at least one of which is non-integral) tobring them to theircomposite pointer type.

This would appear to make the following example ill-formed,

  bool foo(int** x, const int** y) {     return x < y;  // valid ?  }

becauseint** cannot be converted toconst int**,according to the rules of 7.3.6 [conv.qual] paragraph 4. Thisseems too strict for pointer comparison, and current implementationsaccept the example.

Proposed resolution (November, 2012):

The proposed wording is found in document N3478.

(This resolution also resolvesissue 583.)




[8]ページ先頭

©2009-2026 Movatter.jp