================ @@ -3420,6 +3441,15 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, } Result = VD->getEvaluatedValue(); + + // P2280R4 If we don't have a value because this is a reference that was not + // initialized or whose lifetime began within E then create a value with as + // a ConstexprUnknown status. + if (AllowConstexprUnknown) { + if (!Result) { + Result = new APValue(Base, APValue::ConstexprUnknown{}, CharUnits::One()); + } + } ---------------- shafik wrote:
Yes, this is a good point. When I started this a while ago I realized I needed to refactor this but I lost track of it since then. I think I need to use `createTemporary(...)` or something along those lines. https://github.com/llvm/llvm-project/pull/95474 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits