[clang] [clang][StaticAnalyzer] Add support for variables and fields in GetEnclosingDeclContextSignature (PR #214102)

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 4 21:10:09 PDT 2026


ziqingluo-90 wrote:

@NagyDonat I see.  I misunderstood two parts in a similar way:
- `setDeclWithIssue` sets the **enclosing** Decl instead of the Decl being reported.
- `GetEnclosingDeclContextSignature` returns the signature of the argument, which is the enclosing Decl itself, instead of the enclosing Decl of the argument.

To be fair to AI,  I read the doc and function names myself and that's how I understood them.   AI probably can figure out their "real" meanings by looking at how they are used elsewhere.   I think the doc of `setDeclWithIssue` can be clearer if it explicitly states that the argument is the enclosing context of the issue.  A better option is to rename `setDeclWithIssue` to something like `setContextDeclWithIssue`.  Similar for `GetEnclosingDeclContextSignature`.



https://github.com/llvm/llvm-project/pull/214102


More information about the cfe-commits mailing list