================
@@ -2231,6 +2231,13 @@ static bool CheckLValueConstantExpression(EvalInfo 
&Info, SourceLocation Loc,
     return false;
   }
 
+  if (Info.getLangOpts().C23) {
+    auto *VarD = dyn_cast_or_null<VarDecl>(BaseVD);
+    if (VarD && VarD->isConstexpr() && !LVal.isNullPointer()) {
+      Info.report(Loc, diag::err_c23_constexpr_pointer_not_null);
+    }
+  }
----------------
tbaederr wrote:

```suggestion
  if (Info.getLangOpts().C23) {
    if (const auto *VarD = dyn_cast_if_present<VarDecl>(BaseVD);
        VarD && VarD->isConstexpr() && !LVal.isNullPointer())
      Info.report(Loc, diag::err_c23_constexpr_pointer_not_null);
  }
```

https://github.com/llvm/llvm-project/pull/73099
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to