On Tue, Sep 09, 2025 at 02:58:58PM +0000, Qing Zhao wrote: > Just briefly checked the v2, I have the following question: > > There is no change to the routine expand_DEFERRED_INIT for the new “init_type > == AUTO_INIT_CXX26”, > Is this intentional?
Yes. I've checked and all the checks during the expansion were checking for init_type == AUTO_INIT_PATTERN, so AUTO_INIT_CXX26 behaves like AUTO_INIT_ZERO. > If yes, then the new init_type AUTO_INIT_CXX26 will be treated as > AUTO_INIT_ZERO when expanding > the call to .DEFERRED_INIT (size, init_type, …), i.e, the variable will be > zero-initialized. > > Is this expected behavior? Yes. The intent is that -std=c++26 without explicit -ftrivial-auto-var-init= behaves as zero except for no extra __builtin_clear_padding calls. So -ftrivial-auto-var-init=unitialized -std=c++26 would in particular keep the C++23 behavior for projects which can't afford the slowdowns and don't want [[indeterminate]] everywhere. Jakub