================
@@ -810,9 +810,11 @@ void FactsGenerator::handleInvalidatingCall(const Expr 
*Call,
 
   if (!isInvalidationMethod(*MD))
     return;
-  // Heuristics to turn-down false positives.
-  auto *DRE = dyn_cast<DeclRefExpr>(Args[0]);
-  if (!DRE || DRE->getDecl()->getType()->isReferenceType())
+
+  // Heuristics to turn-down false positives. Skip member field expressions for
+  // now. This is not a perfect filter and will still surface some false
+  // positives (e.g. `auto& r = s.v`).
+  if (!isa<DeclRefExpr>(Args[0]->IgnoreParenImpCasts()))
----------------
usx95 wrote:

I see. I would avoid special casing this. We need a more general solution for 
supporting lvalue expressions which are not `DeclRefExpr`. E.g. `(flag ? v1: 
v2).push_back(x)`.

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

Reply via email to