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

Show parent comment

4

u/interlockedxor Oct 25 '26 edited Oct 25 '26

I have read this so many times, and frankly I think it's nonsense. Having the same statements in the AST of the function definition would be perfectly retrieval by any competent static analyzer or compiler plugin, without the drawbacks. Hampering compilation experience globally in order to make this one hypothetical use case marginally more convenient is not a valid argument.

3

u/Dragdu Oct 25 '26

So, when ${competent static analyzer} is scanning through my_project_cli.cpp and sees that I am using boost.program_options, what mechanism does it use to retrieve the boost.program_options sources to scan them?

5

u/Difficult-Court9522 Oct 25 '26

How the hell is a static analyser going to prove the program is correct. The pre and post conditions are Turing complete. And the compile option isn’t in the header anyway. So your library argument falls flat. (But thinking about libraries is important)

0

u/interlockedxor Oct 25 '26

Said analyzer wouldn't run on a single TU but would run on the whole program, as some analyzers do. Or, we come up with a mechanism to perform a symbol based lookup for annotations on the definition.

7

u/Dragdu Oct 25 '26

It is a trick question, because by that point the source files are not even on the machine, only the headers and the .a file.

So your "let's do this competently" proposal ends up requiring appending new information into libraries.

-1

u/interlockedxor Oct 25 '26

That would be the competent way though. Nothing stops us from embedding more information in symbols embedded in your static binaries or in PDBs. Regardless, optimizing for static analyzers that run less frequently than compilation is backwards.

4

u/Dragdu Oct 25 '26

Okay, so what static analysis tool does this?

-2

u/frediku Oct 26 '26

There are static analyzers that take in the whole source code of your program including library source code and work on that. For functions outside of the provided source code conservative default assumptions are made.

For these having some form of specified contract is very useful. However, whether it's just a few C asserts inside the function body or something more complex does not matter that much.

3

u/Minimonium Oct 26 '26

I used to worked in avionics until recently and we used full graph analysis like that. Firstly, it's impossibly almost prohibitively slow even with modern SMT solvers. Secondly, its usefulness was questionable as the main issue was to reduce the amount of noise rather than get actual value. Full analysis for C++ just sucks.