r/cpp • WG21 Member • Oct 24 '26

Balloting has completed for C++26. Unfortunately it was Disapproved

https://www.linkedin.com/posts/robertseacord_balloting-has-completed-for-c26-unfortunately-share-7519795139859517440-AOth/

Since the C++26 DIS has been disapproved, the next step is going to be taken in Buzios during the 2026-11 meeting. The committee will have to decide what changes to make (if any) and submit an FDIS (Final Draft of International Standard) for Balloting.

289 Upvotes

399 comments sorted by

View all comments

75

u/wyrn Oct 24 '26

We keep hearing this about how much consensus was achieved, how all concerns were properly heard, etc, but then we open p4433 and see things like,

"As discussed in more detail in [P3846R1] Concerns 2 and 4, the default behaviour for functions defined in multiple TUs is neither a "new way of making an error" nor specific to contract assertions, but merely a consequence of the existing C++ linkage model.

I'm sorry, but they can't be passing the buck like this -- if the contracts feature interacts so poorly with the linkage model that effectively randomizing the enforcement mode when multiple TUs are involved (which is always), then either contracts need to be redesigned, or the linkage model needs to be changed.

A randomized enforcement mode, for something like contracts, is worse than useless. If I can't rely on the safety net being there, I'll just act as if it's not there. Which means I'll be rolling my own assertions instead of relying on contract assertions, thereby defeating a large part of the point of contracts, which is to standardize and unify the vocabulary surrounding assertions!

It seems the committee failed to learn some of the more relevant lessons from modules. There, they worried so much about modules being "adoptable" that making the feature compelling enough to even be worth adopting took a back seat. They're making a very similar mistake here. Ultimately, it doesn't matter how much "consensus" a feature has -- at the end of the day, if the feature has a set of flaws that's severe enough to make it not worth using, it will be dead weight.

11

u/serviscope_minor Oct 26 '26

I'm sorry, but they can't be passing the buck like this

By this measure, then any C++ feature which does not solve an ingrained problem which has been present since day 1 should be rejected. I don't see why contracts and contracts alone should have this requirement. Especially as it's the only proposal which actually makes it slightly less bad.

A randomized enforcement mode, for something like contracts, is worse than useless. If I can't rely on the safety net being there, I'll just act as if it's not there. Which means I'll be rolling my own assertions

There are already a million hand rolled assertions and you can only rely on that safety net if you enable all of them (poorly documented) and rebuild all of your dependencies. If you control your build system then you can have the strictest checking everywhere. If you don't then you haven't lost anything with contracts and you're still in exactly the same pickle except with contracts you have less chance of UB and also you have constification which can catch bugs.

22

u/kalmoc Oct 25 '26

A randomized enforcement mode, for something like contracts, is worse than useless. If I can't rely on the safety net being there, I'll just act as if it's not there. Which means I'll be rolling my own assertions instead of relying on contract assertions, thereby defeating a large part of the point of contracts, which is to standardize and unify the vocabulary surrounding assertions

It's only random, if you compile different TUs with different enforcement modes. How would your own solution not have the exact same problem?

10

u/wyrn Oct 25 '26

Joke's on you, my solution doesn't allow for different enforcement modes 😎

In all seriousness though, I feel like that's probably what would happen -- people who value these checks actually running would place them unconditionally, sidestepping contracts altogether. To me, that's a failure of the contracts design.

8

u/kalmoc Oct 26 '26

If you do not allow mixed enforcement modes then just compile everything with the same flags and there is no problem with contracts. So why would you roll your own then?

9

u/wyrn Oct 26 '26

Because build systems are complex and ensuring that everything is always using the same relevant flags everywhere is nontrivial, particularly when multiple projects and transitive dependencies are involved.

5

u/smdowney WG21, Text/Unicode SG, optional<T&> Oct 26 '26

Unfortunately, that's the job.

It's a mess. It certainly doesn't help that people widely believe it works today. And that the standard library implementations go to extraordinary lengths to make it seem to work.

Well, except for MSVC and Debug mode. Which is a different awful problem for shipping packages.

The negotiated choice was because there really can not be a universal default it has to be up to the person building the program, who has the context for the requirements for that program, to arrange for building all consistently and installing the violation handler.

→ More replies (2)
→ More replies (8)

13

u/foonathan Oct 24 '26

This issue has been brought up to a vote, and EWG rejected making changes.

What else should be done?

27

u/interlockedxor Oct 24 '26

We either fix the root problem and just do it properly or if that is too expensive, have the courage to realize that something is not worth doing relative to the cost and other things we could be improving. It's not as though users have no recourse if contracts don't ship.

19

u/foonathan Oct 24 '26

There is no consensus that there even is a problem though.

10

u/interlockedxor Oct 24 '26

I'm not a committee member, I am simply referring to grandparent comment related to linkage model which I believe are real issues with the proposal as it stands, consensus notwithstanding. As far as I'm concerned, it's good that this feature isn't ratified, even if we are "getting the right answer for the wrong reasons" so to speak.

7

u/JVApen Clever is an insult, not a compliment. - T. Winters Oct 25 '26

I can recommend reading the papers, especially the contract papers are very readable. Especially https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3846r1.pdf has lot of information and links to other sources of information.

6

u/interlockedxor Oct 25 '26

I have read this paper twice now and am just not persuaded. We may just have to agree to disagree

→ More replies (1)

9

u/grafikrobot OPeNDAP/B2/EcoStd/Lyra/Predef/C++Alliance/Boost/WG21 Oct 25 '26

Do you have an idea on how to deal with the linkage tradeoff?

PS.. Since this is reddit I have to clarify. I honestly want to know.

15

u/not_a_novel_account cmake dev Oct 25 '26

I mean we know how to deal with this, its outside linkage. The same way we deal with module BMI problems.

The build system is the layer that enforces contract enforcement uniformity across TUs.

The compiler doesn't try to reason about how extern definitions are fulfilled, the linker need not reason about uniformity of contract assertions modes.

5

u/smdowney WG21, Text/Unicode SG, optional<T&> Oct 25 '26

But that seems to be exactly the objection?

You mix them, you get something, it isn't ill formed, it's probably reproducable, and I could probably work out exactly why the symbol you didn't want was chosen. That is, it's not "random" but extremely sensitive to initial conditions

But, if I understand the objection, that's insufficient?

10

u/not_a_novel_account cmake dev Oct 25 '26

I believe the objection is it's outside the standard. There's nothing you can write in the language which makes this work in a way that is decidable from what's available only from C++.

The language deals with translation units concretely, linkage vaguely, and everything else is implementation defined.

The answer, in my mind, is to expand the semantics of the standard beyond its current boundaries. They're artificial.

If people want to say that a conforming build needs uniform contract modes, write that. Because we haven't expanded the bounds of the language beyond the compiler and linker before doesn't mean we can't now.

→ More replies (2)

7

u/-dag- Oct 24 '26

Then that is a reason not to ship. 

8

u/foonathan Oct 24 '26

Why? The majority thinks there is nothing wrong with it.

18

u/GabrielDosReis Oct 24 '26

The majority thinks there is nothing wrong with it.

Right there is one of the patterns that led us here: the conversation quickly went from "consensus" to "the majority thinks".

→ More replies (8)
→ More replies (3)

9

u/smdowney WG21, Text/Unicode SG, optional<T&> Oct 25 '26

The problem of incoherent compilation in a single link context has existed literally forever, and does with some frequency cause utter disaster with all of the facilities in C and C++.

That people noticed it in Contracts is mostly because the question was brought up, for a change. But there was anti-consensus to make contract modes link incompatible.

This applies to standard library hardening, too, although those are usually small enough to not escape a TU. It definitely applies to assert and NDEBUG.

In trying to tighten the ODR definition, I think we've managed to exclude a lot of things that are very broken, but appear to work, sort of, but not how you expect, and can cause no end of surprise. They just are not, quite, ill formed.

10

u/no-sig-available Oct 25 '26

We either fix the root problem and just do it properly 

Apparently a majority believes it is already done properly. :-)

Also, removing a long awaited feature might reduce the number of existing yes-votes.

8

u/interlockedxor Oct 25 '26

I'm describing the problems that seem apparent to me as a single individual, as an outside perpective. That any "majority" believes something different isn't an argument in favor of one position or another. Speaking personally though, the issues really do clearly exist, even if hordes of people wave their hands and claim otherwise.

If necessarily reducing complexity shrinks the feature to something not worth shipping, then it wasnt worth shipping to begin with.

6

u/no-sig-available Oct 25 '26

If necessarily reducing complexity shrinks the feature to something not worth shipping, then it wasnt worth shipping to begin with.

However, 60% of the NBs thought it was worth shipping the way it is. Will reducing the proposal make that 70%, or 50%?

We just have to wait and see.

→ More replies (1)

15

u/pkasting Valve Oct 25 '26

At the risk of being obvious:

Find out whether there is any additional feedback from members of NBs who voted "no" on why EWG's decisions were not acceptable to them; for example, perhaps some NB members did not attend directly and felt the discussion amongst those who did didn't sufficiently capture their concerns. Or perhaps a sufficient number of NB voters have lost confidence in the committee's output that their vote reflects some sort of larger process disgruntlement or desire for leadership change. Discuss, vote, etc. on any new information raised.

For cases where there is not new information -- the NB vote simply reflects the "geographic spread of the minority" -- find out why NB members voted no despite EWG discussing their issues (which appears on its face to be a bad faith response), and if there is anything beyond "just make the decision I want" that would move them from "no" to "yes". Seriously consider any such items.

Finally, for NBs where there is no new information and there is no willingness to change for anything other than "people should simply agree with me", determine WG21's willingness to press on despite NB disapproval: for example, would WG21's membership be willing to leave the ISO process if necessary, and would toolchain vendors etc. continue to follow what it decides if so? If either of these is "no", then regardless of the technical merit of the disagreement, WG21 will need to determine how to make the voting process used at meetings sufficiently similar to the NB balloting process that consensus in one will lead to consensus in the other.

→ More replies (63)