Created on 2025-11-15.00:00:00 last changed 4 days ago
CWG 2026-03-06
This issue is resolved by the resolution of issue 3162.
Possible resolution:
Change in 7.7 [expr.const] paragraph 32 as follows:
... During the evaluation V of an expression E as a core constant expression, the evaluation context of an evaluation X (6.10.1 [intro.execution]) consists of the following points:
- The program point EVAL-PT(L) and any synthesized point in the instantiation context thereof, where L is the point at which E appears, and where EVAL-PT(P ), for a point P , is a point R determined as follows:
- ...
- Each synthesized point corresponding to an injected declaration produced by any evaluation sequenced before X (6.10.1 [intro.execution]).
(From submission #810.)
Consider:
template <typename T>
struct TCls {
T mem;
static_assert(size_of(^^T) > 0); // <-- problem
};
struct S;
consteval {
constexpr auto ctx = std::meta::access_context::current();
if (nonstatic_data_members_of(substitute(^^TCls, {define_aggregate(^^S, {})}), ctx).size() > 1)
throw "contrived, but whatever";
}
Nothing in the definition of "evaluation context" takes the synthesized point associated with S from the instantiation context of TCls<S> into the evaluation context of the static assertion.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-03-06 21:39:32 | admin | set | messages: + msg8499 |
| 2026-03-06 21:39:32 | admin | set | status: drafting -> review |
| 2026-02-06 22:00:31 | admin | set | status: open -> drafting |
| 2025-11-18 22:21:13 | admin | set | messages: + msg8398 |
| 2025-11-15 00:00:00 | admin | create | |