[clang] [CIR] Implement aggregate-expr-init with a const-expr lowering (PR #190631)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 11:36:52 PDT 2026


================
@@ -303,7 +304,19 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
                      "AggExprEmitter: VisitSubstNonTypeTemplateParmExpr");
   }
   void VisitConstantExpr(ConstantExpr *e) {
-    cgf.cgm.errorNYI(e->getSourceRange(), "AggExprEmitter: VisitConstantExpr");
+    ensureDest(cgf.getLoc(e->getSourceRange()), e->getType());
+
+    if (mlir::Attribute result = ConstantEmitter(cgf).tryEmitConstantExpr(e)) {
----------------
erichkeane wrote:

Yeah, I found that too.  I picked up my test partially from there.  

I didn't have claude claim that (I actually sycc'ed it on it too), but didn't come up with anything.  The original line was added without a test that hits it, so I doubt we'll hit it.

We DID implement it near-token identical, so I suspect the implementation is ok though.

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


More information about the cfe-commits mailing list