mp-units expresses preconditions as pre() on the declaration when contracts are available (P2900, C++26), guarded on __cpp_contracts >= 202502L. The bundled Clang rejects them.
Reproduced with MrDocs 2026.9.4 (LLVM 23.0.0git) on a declaration equivalent to:
[[nodiscard]] constexpr const_reference operator[](size_type pos) const pre(pos < N);
With -std=c++26, and again with -std=c++2c -fcontracts, both fail identically with expected ';' at end of declaration list followed by cascading use of undeclared identifier errors, and the corpus comes out empty (0 pages). Passing -fcontracts made no difference to the diagnostics.
So today we have to generate the reference with contracts switched off, which is a pity, because the contracts are the part of the interface a reader most wants to see.
Questions: is P2900 support in the bundled toolchain on the roadmap, and in the meantime is there a way to have the parser skip a contract annotation rather than fail the translation unit?
mp-units expresses preconditions as
pre()on the declaration when contracts are available (P2900, C++26), guarded on__cpp_contracts >= 202502L. The bundled Clang rejects them.Reproduced with MrDocs 2026.9.4 (LLVM 23.0.0git) on a declaration equivalent to:
With
-std=c++26, and again with-std=c++2c -fcontracts, both fail identically withexpected ';' at end of declaration listfollowed by cascadinguse of undeclared identifiererrors, and the corpus comes out empty (0 pages). Passing-fcontractsmade no difference to the diagnostics.So today we have to generate the reference with contracts switched off, which is a pity, because the contracts are the part of the interface a reader most wants to see.
Questions: is P2900 support in the bundled toolchain on the roadmap, and in the meantime is there a way to have the parser skip a contract annotation rather than fail the translation unit?