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

2026-02-06


3127. Evaluation context is missing synthesized points

Section: 7.7  [expr.const]     Status: drafting     Submitter: Dan Katz     Date: 2025-11-15

(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.

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: