================
@@ -723,6 +723,17 @@ void FactsGenerator::handleInvalidatingCall(const Expr 
*Call,
         ThisList->getOuterOriginID(), Call));
 }
 
+void FactsGenerator::handleImplicitObjectFieldUses(const Expr *Call,
+                                                   const FunctionDecl *FD) {
+  const auto *MD = dyn_cast<CXXMethodDecl>(FD);
+  if (!MD || !MD->isInstance())
+    return;
+
+  for (const auto *Field : MD->getParent()->fields())
----------------
NeKon69 wrote:

I tried implementing this, but unfortunately, even though fields from base 
class do run `UseFields` function, and each get a `UseFact`, they don't produce 
a warning? I suspect that may be because they are getting associated with the 
wrong thing here, I am not entirely sure to be honest.

So this still doesn't get diagnosed currently:

```
struct X {
    int* x;
};

struct Y : X {
    int* y;
    int foo();
    void bar() {
        {
            int a;
            x = &a;
        }
        foo();
        x = nullptr;
    }
};
```

https://github.com/llvm/llvm-project/pull/191731
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to