[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Thu May 16 10:43:54 PDT 2024


================
@@ -661,6 +681,11 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
 
   diagnoseNullableToNonnullConversion(Ty, E->getType(), E->getBeginLoc());
   diagnoseZeroToNullptrConversion(Kind, E);
+  if (!isCast(CCK) && !E->isNullPointerConstant(
+                          Context, Expr::NPC_NeverValueDependent /* ???*/)) {
----------------
dougsonos wrote:

I found a much better way to check for a null pointer; there's already another local enum that says.

https://github.com/llvm/llvm-project/pull/84983


More information about the cfe-commits mailing list