================
@@ -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)) {
----------------
andykaylor wrote:

FWIW, it looks like the call to tryEmitConstantExpr was added here: 
https://github.com/llvm/llvm-project/commit/51e4aa87e05c45bebf9658a47980b1934c88be31#diff-9cc9cfa9ad2060b97c7bf2689654a4b54799316d0557775ecf6d9d9b21af7b46

The fallthrough branch was executed unconditionally before that change.

I tried using Claude to find a case that would hit this code, and it claims it 
can happen when Pointer Field Protection is used.

https://github.com/llvm/llvm-project/pull/190631
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to