This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-10-26
[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]
Function invocation substitution (9.2.6 [dcl.constexpr] paragraph 5) seems underspecified with respect to this.
Proposed resolution (August, 2011):
Change the indicated bullet of 7.7 [expr.const] paragraph 2 as follows:
this (7.5 [expr.prim]
_N4567_.5.1.1 [expr.prim.general]) unless it appears as the
postfix-expression in a class member access expression,
including the result of the implicit transformation in the body of a
non-static member function (11.4.3 [class.mfct.non.static])
[Note: when evaluating a constant expression, function
invocation substitution (9.2.6 [dcl.constexpr]) replaces each
occurrence of this in a constexpr member function
with a pointer to the class object. —end
note];
Change 9.2.6 [dcl.constexpr] paragraph 5 as follows (converting the running text into a bulleted list):
Function invocation substitution for a call of a constexpr function or of a constexpr constructor means:
implicitly converting each argument to the corresponding parameter type as if by copy-initialization,91
substituting that converted expression for each use of the corresponding parameter in the function-body,
in a member function, substituting for each use of this (_N4868_.11.4.3.2 [class.this]) a prvalue pointer whose value is the address of the object for which the member function is called, and
forin a constexpr functions, implicitly converting the resulting returned expression or braced-init-list to the return type of the function as if by copy-initialization.Such substitution...
This resolution also resolves issues 1264 and 1367.