[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 06:26:16 PDT 2024


================
@@ -144,9 +144,24 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator *B,
     // Allow arithmetic on different symbolic regions.
     if (isa<SymbolicRegion>(SuperLR) || isa<SymbolicRegion>(SuperRR))
       return;
+    if (const auto *SuperDLR = dyn_cast<DeclRegion>(SuperLR))
+      DiffDeclL = SuperDLR->getDecl();
+    if (const auto *SuperDRR = dyn_cast<DeclRegion>(SuperRR))
+      DiffDeclR = SuperDRR->getDecl();
----------------
balazske wrote:

Warning is now omitted if both would be at the same declaration.

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


More information about the cfe-commits mailing list