================
@@ -299,6 +299,7 @@ class RawPtrRefMemberChecker
BR->getSourceManager());
auto Report = std::make_unique<BasicBugReport>(Bug, Os.str(), BSLoc);
Report->addRange(Member->getSourceRange());
+ Report->setDeclWithIssue(Member);
----------------
NagyDonat wrote:
If I understand it correctly this new call is the reason why you extended
`GetEnclosingDeclContextSignature` with cases for `Field`, `Var`, `ParamVar`
and `ObjCIvar` declarations (that recursively call
`GetEnclosingDeclContextSignature`).
You should remove those recursive branches and change this line to
`Report->setDeclWithIssue(getDeclarationContaining(Member))` where you use a
new helper method `getDeclarationContaining` which converts the
`Field`/`Var`/`ParamVar`/`ObjCIvar` to the enclosing declaration context or
interface the same way as you do now to prepare for the recursive calls of
`GetEnclosingDeclContextSignature`. (If `Member` can be anything else, you
should still convert it to the enclosing declaration context for the sake of
consistency.)
https://github.com/llvm/llvm-project/pull/214102
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits