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

2026-03-26


3158. Constification for splice-expressions

Section: 7.5.9  [expr.prim.splice]     Status: review     Submitter: Daniel M. Katz     Date: 2026-02-05     Liaison: (EWG)

(From submission #844.)

Consider:

  void f(int p)
    pre([&] { ++p; return true; }())         // error: unqualified-id 'p' has const type
    pre([&] { ++[:^^p:]; return true; }())   // OK
  {}

Constification inside contract assertions applies to unqualified-ids (used as an id-expression) only. Reflection makes it easy to to circumvent this restriction, even though reflection is a compile-time process that could also apply constification.

2026-02-22

Forwarded to EWG with paper issue #2621, by decision of the CWG chair.

EWG 2026-03-24

This issue should be closed as NAD.

EWG 2026-03-26

This issue should be accepted, and is resolved by paper P3598R0.