[Bug c++/126868] -ftrivial-auto-var-init=uninitialized should be incompatible with -std=c++26 (or at least warn about it)

"peppe at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126868

--- Comment #5 from Giuseppe D'Angelo <peppe at gcc dot gnu.org> ---
My code didn't have [[indeterminate]]? It was externally injected by the flag.
And that's why I think it's dangerous -- it gives my code a meaning I have no
way to prevent.

> Having a user a way to opt out is really necessary, while in a lot of code the extra cost isn't that significant, e.g. in huge switches with a lot of vacuously initialized variables in the scope of the switch body, the cost can be significant.  And the users should have a way to opt out, not just to use -std=c++23 forever because they aren't willing to accept the slowdowns.

But why doesn't the flag just stop the wiping, *without* re-engaging the UB, so
the missiles still don't get fired? This way the blast radius would be much
much smaller? (Yes, technically speaking it'd still be non-conforming because
it doesn't wipe.)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.