================
@@ -738,7 +738,7 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, 
bool AllowOverwrite) {
     // Zero-sized fields are not emitted, but their initializers may still
     // prevent emission of this struct as a constant.
     if (isEmptyFieldForLayout(CGM.getContext(), Field)) {
-      if (Init->HasSideEffects(CGM.getContext()))
+      if (Init && Init->HasSideEffects(CGM.getContext()))
----------------
AaronBallman wrote:

We should check GCC's behavior and follow their lead since it's a GNU 
extension, but my hope is that we can extend the logic for the GNU extension as 
well (I think it's more intuitive).

https://github.com/llvm/llvm-project/pull/109271
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to