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

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 10:44:29 PDT 2024


================
@@ -671,6 +684,10 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
 
   diagnoseNullableToNonnullConversion(Ty, E->getType(), E->getBeginLoc());
   diagnoseZeroToNullptrConversion(Kind, E);
+  if (!isCast(CCK) &&
+      !E->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNotNull)) {
----------------
dougsonos wrote:

This seems to be causing some failed tests. `isNullPointerConstant` calls `Expr::EvaluateKnownConstInt` where this assertion fails:
```
  assert(!isValueDependent() &&
         "Expression evaluator can't be called on a dependent expression.");
```

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


More information about the cfe-commits mailing list