================ @@ -365,10 +365,15 @@ mlir::Attribute ConstantEmitter::tryEmitPrivateForVarInit(const VarDecl &d) { if (!d.hasLocalStorage()) { QualType ty = cgm.getASTContext().getBaseElementType(d.getType()); if (ty->isRecordType()) - if (d.getInit() && isa<CXXConstructExpr>(d.getInit())) { - cgm.errorNYI(d.getInit()->getBeginLoc(), - "tryEmitPrivateForVarInit CXXConstructExpr"); - return {}; + if (const CXXConstructExpr *e = + dyn_cast_or_null<CXXConstructExpr>(d.getInit())) { + const CXXConstructorDecl *cd = e->getConstructor(); ---------------- andykaylor wrote:
I see. If I add `-std=c++14` to my compile line, that gets the elidable constructor in the AST, and then `-fno-elide-constructors` get us to emit CIR for it but not here. That's handled in `emitCXXConstructExpr` (which has not been upstreamed yet). I guess the `cd->isTrivial() && cd->isDefaultConstructor()` check prevents us from doing anything with it here. https://github.com/llvm/llvm-project/pull/138368 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits