================
@@ -402,7 +410,20 @@ class LifetimeSafetySemaHelperImpl : public
LifetimeSafetySemaHelper {
std::string getDiagSubjectDescription(const ValueDecl *VD) {
std::string Res;
llvm::raw_string_ostream OS(Res);
- OS << (isa<ParmVarDecl>(VD) ? "parameter" : "local variable");
+ if (isa<FieldDecl>(VD)) {
+ OS << "field";
+ } else if (isa<ParmVarDecl>(VD)) {
+ OS << "parameter";
+ } else if (const auto *Var = dyn_cast<VarDecl>(VD)) {
+ if (Var->isStaticLocal() || Var->isStaticDataMember())
+ OS << "static variable";
+ else if (Var->hasGlobalStorage())
+ OS << "global variable";
+ else
+ OS << "local variable";
+ } else {
+ OS << "local variable";
----------------
NeKon69 wrote:
You mean on the last one? Yeah, I agree here.
https://github.com/llvm/llvm-project/pull/200147
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits