Created on 2026-02-05.00:00:00 last changed 1 month ago
(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.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-02-05 00:00:00 | admin | create | |