From 7304230013170b813b38c0df73f47e3c1538794a Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Sun, 4 Jun 2023 10:49:52 -0500 Subject: [PATCH] For the CMS mutable member checker the hash for a field declaration should be scoped. (#12) (#13) * For the CMS mutable member checker the hash for a field declaration should be scoped. This leads to reports for variables with the same name in different classes in the same translation unit getting the same hash. The output name of the report uses the hash so the last report was the only report for that variable. * Move to grouped Decl::'s remove Decl ending add Var --- clang/lib/Analysis/IssueHash.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/lib/Analysis/IssueHash.cpp b/clang/lib/Analysis/IssueHash.cpp index 94816747668da9..39101a8a75465d 100644 --- a/clang/lib/Analysis/IssueHash.cpp +++ b/clang/lib/Analysis/IssueHash.cpp @@ -97,6 +97,8 @@ static std::string GetEnclosingDeclContextSignature(const Decl *D) { case Decl::Record: case Decl::CXXRecord: case Decl::Enum: + case Decl::Field: + case Decl::Var: DeclName = ND->getQualifiedNameAsString(); break; case Decl::CXXConstructor: