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

2023-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20e81a80e9cb: Update with warning message for comparison to NULL pointer (authored by Krishna-13-cyber, committed by aaron.ballman). Changed prior to commit: https://reviews.llvm.org/D149000?vs=531243&i

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

2023-06-14 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber added a comment. In D149000#4420607 , @aaron.ballman wrote: > LGTM! There's still a formatting issue in warn-tautological-compare.c but I > can fix that up when landing, assuming you still need me to land this on your > behalf. (If you

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

2023-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! There's still a formatting issue in warn-tautological-compare.c but I can fix that up when landing, assuming you still need me to land this on your behalf. (If you can land

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

2023-06-14 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber updated this revision to Diff 531243. Krishna-13-cyber removed a reviewer: Quuxplusone. Krishna-13-cyber added a comment. - Update with the given suggestion - Add release notes Thanks a lot @aaron.ballman for the instant assistance. Repository: rG LLVM Github Monorepo CHANGE

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

2023-06-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:14726 - if (UnaryOperator *UO = dyn_cast(E)) { + if (UnaryOperator *UO = dyn_cast(E->IgnoreParenCasts())) { if (UO->getOpcode() != UO_AddrOf) aaron.ballman wrote: > The iss

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

2023-04-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Precommit CI is still failing on test/SemaCXX/constant-expression-cxx2a.cpp with a false positive warning. You'll need to investigate why that's happening, but I suspect that the warning logic isn't aware that `dynamic_cast` can return null. Co

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

2023-04-26 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber updated this revision to Diff 517151. Krishna-13-cyber added a comment. - Updated with re-adding the required diagnostic message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149000/new/ https://reviews.llvm.org/D149000 Files: c

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

2023-04-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/conditional-expr.c:89 char x; - return &x) != ((void *) 0)) ? (*(&x) = ((char) 1)) : (void) ((void *) 0)), (unsigned long) ((void *) 0)); // expected-warning {{C99 forbids conditional expressions with only

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

2023-04-25 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber updated this revision to Diff 516857. Krishna-13-cyber added a comment. - Updated with reviewed changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149000/new/ https://reviews.llvm.org/D149000 Files: clang/lib/Sema/SemaCheckin

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

2023-04-24 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/test/Sema/warn-tautological-compare.c:102 +} \ No newline at end of file Please add back the missing newline Comment at: clang/test/SemaCXX/constant-expression-cxx2a.cpp:252 // ... but in the

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

2023-04-24 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber updated this revision to Diff 516397. Krishna-13-cyber added a comment. - Update with addition of testcase - There is an issue for which the build fails,actually when I replace the diagnostic by `comparison of address of 'x' not equal to a null pointer is always true` in **/clan

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

2023-04-23 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber updated this revision to Diff 516201. Krishna-13-cyber added a comment. - Update with diagnostic addition Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149000/new/ https://reviews.llvm.org/D149000 Files: clang/lib/Sema/SemaCheck

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

2023-04-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Both test failures look like you just need to add the additional new diagnostic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149000/new/ https://reviews.llvm.org/D149000 ___ cf

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

2023-04-22 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber updated this revision to Diff 516087. Krishna-13-cyber added a comment. - Apologies for uploading some other/incorrect diff - Updated Diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149000/new/ https://reviews.llvm.org/D149000

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

2023-04-22 Thread Krishna Narayanan via Phabricator via cfe-commits
Krishna-13-cyber created this revision. Krishna-13-cyber added reviewers: aaron.ballman, tbaeder, Quuxplusone. Herald added a project: All. Krishna-13-cyber requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch solves the issue pointed