Created on 2026-07-17.00:00:00 last changed 5 days ago
Suggested resolution:
Change in 7.7.2 [expr.const.core] bullet 2.1 as follows:
An expression E is a core constant expression unless the evaluation of E, following the rules of the abstract machine (6.10.1 [intro.execution]), would evaluate one of the following:
- this (7.5.3 [expr.prim.this]), except
- in a constexpr function (9.2.6 [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 (7.6.1.5 [expr.ref]);
- ...
(From submission #949.)
Consider:
constexpr struct A {
A* p = this;
} a;
This use of this during constant evaluation is not, but ought to be, permitted by 7.7.2 [expr.const.core] paragraph 2.1.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-08-09 12:10:17 | admin | set | messages: + msg8642 |
| 2026-07-17 00:00:00 | admin | create | |