================
@@ -118,7 +210,26 @@ class ConstExprEmitter
   }
 
   mlir::Attribute VisitInitListExpr(InitListExpr *ile, QualType t) {
-    cgm.errorNYI(ile->getBeginLoc(), "ConstExprEmitter::VisitInitListExpr");
+    if (ile->isTransparent())
+      return Visit(ile->getInit(0), t);
+
+    if (ile->getType()->isArrayType()) {
+      // If we return null here, the non-constant initializer will take care of
+      // it, but we would prefer to handle it here.
+      assert(!cir::MissingFeatures::constEmitterArrayILE());
+      return {};
+    }
+
+    if (ile->getType()->isRecordType())
+      cgm.errorNYI(ile->getBeginLoc(), "ConstExprEmitter: record ILE");
----------------
mmha wrote:

I'd add an explicit `return {};` here just from a defensive programming 
standpoint.

Should this also have its own `MissingFeature` assert?

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

Reply via email to