3 ms·
> -ftrivial-auto-var-init=pattern I believe this only helps for trivial automatic variables; not non-trivial automatic variables (structs/classes) that contain
by loeg 1y ago
> -ftrivial-auto-var-init=pattern
I believe this only helps for trivial automatic variables; not non-trivial automatic variables (structs/classes) that contain uninitialized trivial members.
- TuxSH 1y agoAh, you're right, thanks for correcting me! This also doesn't apply to heap-allocated variables, though I think p2795r2 should cover all these cases. I wonder if (for stack variables) this is due to an implementation detail in the compiler. After all, non-trivial classes have 'actual' constructors that run and that is supposed to initialize their respective class instances...