[clang] [clang][CodeGen] Zero init unspecified fields in initializers in C (PR #97121)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 13:43:06 PDT 2024


================
@@ -715,6 +772,11 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) {
     if (CXXRD->getNumBases())
       return false;
 
+  // See comment in getPadding().
+  bool ZeroInitPadding = !CGM.getLangOpts().CPlusPlus;
----------------
efriedma-quic wrote:

Can we unify this into a helper?

https://github.com/llvm/llvm-project/pull/97121


More information about the cfe-commits mailing list