https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119179
Bug ID: 119179 Summary: Allow the [[gnu:::uninitialized]] attribute on classes / non-static data members Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dangelog at gmail dot com Target Milestone: --- When building under -ftrivial-auto-var-init, certain classes that contain buffers (e.g. for SBO) and/or are used as "buffers" on the stack are now automatically filled with byte patterns. This may cause a performance hit in sensitive code paths. The [[gnu::uninitialized]] attribute can be used to prevent such a hit, but that requires annotating all use sites. That's extremely invasive and error-prone. It would be much more ergonomic if one could annotate with the attribute the class itself and/or certain non-static data members, so that every usage will automatically avoid the byte filling.