[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

Ryosuke Niwa via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 20 15:59:55 PDT 2023


================
@@ -44,9 +46,25 @@ bool hasPublicRefAndDeref(const CXXRecordDecl *R) {
 
 namespace clang {
 
-std::optional<const clang::CXXRecordDecl*>
-isRefCountable(const CXXBaseSpecifier* Base)
-{
+std::optional<const clang::CXXRecordDecl *>
+hasPublicRefInBase(const CXXBaseSpecifier *Base) {
+  assert(Base);
+
+  const Type *T = Base->getType().getTypePtrOrNull();
+  if (!T)
+    return std::nullopt;
----------------
rniwa wrote:

Hm... this seems like a much more involved refactoring so perhaps we should do it in a separate pass? WDYT?

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


More information about the cfe-commits mailing list