C++ vs. -ftrivial-auto-var-init= vs. vacuous initialization & jumps
Jason Merrill
jason@redhat.com
Sat Sep 6 14:04:04 GMT 2025
On 9/3/25 8:40 PM, Qing Zhao wrote:
>
> I have one question (might be a stupid question):
>
> Should we consider a call to C++’s constructor as the initialization to that variable?
>
> For example:
>
> S::S (&s);
>
> Should we consider the above as an initialization to the variable s?
> then -ftrivial-auto-var-init should NOT insert the DEFFRRED_INIT to s?
The constructor might not fully initialize the variable, so I would keep
the DEFERRED_INIT.
Jason
More information about the Gcc
mailing list