Full name of submitter: Brian Bi
Issue description: [expr.const.core]/2.1 permits the use of this during constant evaluation only in a constexpr function or as the postfix-expression of a class member access expression. This rule appears to prohibit, e.g.
constexpr struct A {
A* p = this;
} a;
static_assert(a.p == &a);
Suggested resolution: Edit [expr.const.core]/2.1 as follows:
this ([expr.prim.this]), except
- in a constexpr function ([dcl.constexpr]) that is being evaluated as part of E
or ,
- in a default member initializer for an object that is being initialized as part of E, or
- when appearing as the postfix-expression of an implicit or explicit class member access expression ([expr.ref])
Full name of submitter: Brian Bi
Issue description: [expr.const.core]/2.1 permits the use of
thisduring constant evaluation only in a constexpr function or as the postfix-expression of a class member access expression. This rule appears to prohibit, e.g.Suggested resolution: Edit [expr.const.core]/2.1 as follows: