[clang] [Clang][Sema] Warn on a function reference compared/converted to null (PR #204944)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 3 08:13:00 PDT 2026
================
@@ -14296,6 +14299,10 @@ void Sema::DiagnoseAlwaysNonNullPointer(Expr *E,
if (!IsFunction)
return;
+ // The fix-it notes below only apply to a bare function name, not a reference.
+ if (IsFunctionReference)
+ return;
----------------
cor3ntin wrote:
Please merge these 2 `if`s. Thanks
https://github.com/llvm/llvm-project/pull/204944
More information about the cfe-commits
mailing list