================
@@ -117,6 +117,11 @@ Stmt *AnalysisDeclContext::getBody(bool
&IsAutosynthesized) const {
return BD->getBody();
else if (const auto *FunTmpl = dyn_cast_or_null<FunctionTemplateDecl>(D))
return FunTmpl->getTemplatedDecl()->getBody();
+ else if (const auto *VD = dyn_cast_or_null<VarDecl>(D)) {
+ if (VD->hasGlobalStorage()) {
----------------
zwuis wrote:
`hasGlobalStorage` is used here but `isFileVarDecl` is used elsewhere. It seems
that you want to handle `static` variables in function bodies. Do we have tests
with it, or could you please adding tests regardless of whether it's supported?
https://github.com/llvm/llvm-project/pull/163885
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits