[clang] [LifetimeSafety] More support for member expressions (PR #191865)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 17 02:06:10 PDT 2026
================
@@ -386,28 +387,35 @@ void FactsGenerator::handleAssignment(const Expr *LHSExpr,
// assigned.
RHSList = getRValueOrigins(RHSExpr, RHSList);
- if (const auto *DRE_LHS = dyn_cast<DeclRefExpr>(LHSExpr)) {
- QualType QT = DRE_LHS->getDecl()->getType();
+ const ValueDecl *VD = nullptr;
+ if (const auto *DRE = dyn_cast<DeclRefExpr>(LHSExpr))
+ VD = DRE->getDecl();
+ else if (const auto *ME = dyn_cast<MemberExpr>(LHSExpr))
+ VD = ME->getMemberDecl();
----------------
Xazax-hun wrote:
Should we leave a FIXME for nested `MemberExpr`s?
https://github.com/llvm/llvm-project/pull/191865
More information about the cfe-commits
mailing list