[PATCH] D69664: [Diagnostics] Teach -Wnull-dereference about address_space attribute

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 08:37:32 PDT 2019


xbolva00 marked an inline comment as done.
xbolva00 added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:486
     if (UO->getOpcode() == UO_Deref &&
-        UO->getSubExpr()->IgnoreParenCasts()->
-          isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull) &&
+        !isTargetAddressSpace(
+            UO->getSubExpr()->getType()->getPointeeType().getAddressSpace()) &&
----------------
With this patch, we no longer warn for:

*(int __attribute__((address_space(0))) *) 0;

Worth to handle this case?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69664/new/

https://reviews.llvm.org/D69664





More information about the cfe-commits mailing list