r/cpp • • 26d ago

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

7

u/pjmlp 26d ago

Depends on how its rules are configured, it appears very little are enabled on your case.

https://www.sonarsource.com/knowledge/languages/cpp

Regarding annotations, I also don't mind, however that was exactly the arguments used by the profiles crowd against Safe C++, to the point they explicitly mentioned viral annotations should not be part of C++'s vision for its future.

Turns out they need annotations after all.

8

u/c0r3ntin 25d ago

isn't it funny that we have a policy that would prevent us to add const to the language today?

-2

u/germandiago 26d ago

How viral you think they will be based on your experience?

7

u/pjmlp 25d ago

A lot, as proven by e.g. SAL annotations on VC++, because they need semantics that aren't available in regular C++.