================
@@ -18455,9 +18452,9 @@ HandleImmediateInvocations(Sema &SemaRef,
   if (SemaRef.getLangOpts().CPlusPlus23 &&
       Rec.ExprContext ==
           Sema::ExpressionEvaluationContextRecord::EK_VariableInit) {
-    auto *VD = cast<VarDecl>(Rec.ManglingContextDecl);
-    if (VD->isUsableInConstantExpressions(SemaRef.Context) ||
-        VD->hasConstantInitialization()) {
+    auto *VD = dyn_cast_or_null<VarDecl>(Rec.ManglingContextDecl);
----------------
erichkeane wrote:

Have we come across a situation when `Rec.ManglingContextDecl` is null?  Is 
that possible?  If not, we probably should leave this as just dyn_cast.

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

Reply via email to