• Sources: primary
  • Summary: At CppCon 2026 Doumler said pre and post on virtual functions, removed from C++26, were voted into the C++29 draft, checking the statically called function's precondition, the final overrider's precondition, then both postconditions in reverse order, rather than Eiffel's OR and AND rules. The other five extensions in roadmap paper P3850 are user-defined violation messages, explicitly triggered violations including a hook for C assert, postcondition captures of old values and parameters, labels that group assertions and constrain their evaluation semantics, and implicit assertions for undefined behavior. All six are implemented on GCC and Clang branches available in Compiler Explorer.
  • Why it matters: C++ teams adopting C++26 contract_assert, pre and post can see which gaps, such as per-library control and virtual function support, are on track for C++29.
  • Background: C++26 contract assertions are language keywords that replace the assert macro, with build-time evaluation semantics ignore, observe, enforce and quick-enforce and a replaceable violation handler. WG21 kept them in C++26 at its Búzios meeting after a failed ISO ballot.