# C++26 contracts

**URL:** https://discourse.cmake.org/t/c-26-contracts/15644
**Category:** Development
**Created:** [May 8, 2026, 12:12pm UTC](https://discourse.cmake.org/t/c-26-contracts/15644 "2026-05-08T12:12:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Lieven](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/c37758/32.png) [@Lieven](https://discourse.cmake.org/u/Lieven)
#### Post date: [May 8, 2026, 12:12pm UTC](https://discourse.cmake.org/t/c-26-contracts/15644/1 "2026-05-08T12:12:20Z")

</div>

How will cmake deal with this ?  
For example on gcc, one has to specify both ‘-fcontracts’ both to the compiler, and to the linker.

No idea what the option will be for clang or MSVC.

Will this be left to the user, or will cmake foresee an abstraction (a per target property, default by a global CMAKE\_xxx property) ?

And how about specifying the standard semantic (ignore/observe/enforce ,quick\_enforce) ?

---

<div class="post-metadata">

### Author: ![vito.gamberini](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vito.gamberini/32/4376_2.png) [@vito.gamberini](https://discourse.cmake.org/u/vito.gamberini)
#### Post date: [June 29, 2026, 6:08pm UTC](https://discourse.cmake.org/t/c-26-contracts/15644/2 "2026-06-29T18:08:31Z")

</div>

Historically CMake does not add mechanisms for experimental compiler features.

For example, `-lstdc++fs` for `std::filesystem` was never given an abstraction, nor are there plans to support `-freflection`.

It is unlikely `-fcontracts` will be treated differently.

The enforcement semantic is a different story. Once compilers have stable implementations and interfaces for enforcement semantics, some collection of properties will likely need to be implemented for them.
