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

2024-11-11


1652. Object addresses in constexpr expressions

Section: 7.6.10  [expr.eq]     Status: CD4     Submitter: Richard Smith     Date: 2013-04-15

[Moved to DR at the May, 2015 meeting.]

Pointer equality is defined by reference to the addresses of the objects designated by the pointer values, reflecting the implementation technique of most/all compilers. However, this definition is intrinsically a runtime property, and such a description is inappropriate with respect to constexpr expressions, which must deal with pointer comparisons without necessarily knowing the runtime layout of the objects involved. A better definition usable at compile time is needed.

Proposed resolution (November, 2014):

Change 7.6.10 [expr.eq] paragraph 2, converting the existing running text into bullets, as follows:

If at least one of the operands is a pointer, pointer conversions (7.3.12 [conv.ptr]) and qualification conversions (7.3.6 [conv.qual]) are performed on both operands to bring them to their composite pointer type (Clause 7 [expr]). Comparing pointers is defined as follows: Two pointers compare equal