[PATCH] D149000: Update with warning message for comparison to NULL pointer

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 08:11:47 PDT 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:14726
 
-  if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E)) {
+  if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E->IgnoreParenCasts())) {
     if (UO->getOpcode() != UO_AddrOf)
----------------
aaron.ballman wrote:
> 
The issue with the failing precommit CI test is because you're ignoring parens and casts with your changes, and to resolve the problem from the issue you should be ignoring parens alone.

Try replacing `IgnoreParenCasts()` with `IgnoreParens()` and things should work better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149000



More information about the cfe-commits mailing list