r/cpp • • Oct 25 '26

C++ profiles for initialization and invalidation: WIP implementation prototypes already exist in GCC/Clang

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4415r0.pdf

In this paper it can be seen some interesting profiles progress for prototypes in Gcc and Clang.

20 Upvotes

29 comments sorted by

View all comments

0

u/Jealous_Security_362 Oct 25 '26

Getting prototypes into both GCC and Clang is the part that usually kills these proposals, so that's a good sign. Does it catch use after move across function calls, or only inside a single body? The interprocedural case is where false positives will decide whether people adopt it

3

u/ts826848 Oct 25 '26

  Getting prototypes into both GCC and Clang is the part that usually kills these proposals

I don't think either of these prototypes are "in" GCC/Clang proper. The GCC prototype at least is definitely in a separate fork and if I'm reading the paper correctly the Clang implementation is too.

-5

u/germandiago Oct 25 '26

I also heard all the time that "design by committee" without prototypes is very bad. 

Is there any way to do both at once? It would be twice as bad bc it is C++ anyway?

6

u/Jealous_Security_362 Oct 25 '26

They're not opposites. The prototype is how you find out which rules can actually be implemented before the wording is frozen. Design by committee goes wrong when it designs something nobody has built, not when it reacts to something someone has.

0

u/germandiago Oct 25 '26

The papers have revisions based on these imolementations feedback I would say. This is iterative.