[clang] [clang][ThreadSafety] Resolve sibling members of function pointer fields against the called object (PR #231602)
Jameson Nash via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 26 07:49:09 PDT 2026
================
@@ -137,21 +151,20 @@ CapabilityExpr SExprBuilder::translateAttrExpr(const Expr *AttrExp,
if (!DeclExp)
/* We'll use Self. */;
else if (const auto *ME = dyn_cast<MemberExpr>(DeclExp)) {
- Ctx.SelfArg = ME->getBase();
- Ctx.SelfArrow = ME->isArrow();
+ Ctx.SelfArg = ME->getBase();
} else if (const auto *CE = dyn_cast<CXXMemberCallExpr>(DeclExp)) {
----------------
vtjnash wrote:
Yes, but it was intentionally deferred for later. Sema currently calls `checkThreadSafetyValueDeclIsFunPtr` which checks `isFunctionPointerType()` and gets false for those, so it drops the attribute with "attribute on a field requires the field to be of function pointer type". I already do have a branch that implements it, but there's many textual conflicts between the various PRs, so I've had to drip out the changes to avoid pointless conflicts (various fixes have to add branches, while others remove them, and others rewrite them -- and it wasn't worth making reviewers see all the various forms the same diff can take, when the end state is the same).
https://github.com/llvm/llvm-project/pull/231602
More information about the cfe-commits
mailing list