================ @@ -18,24 +18,26 @@ using namespace clang; namespace { -bool hasPublicRefAndDeref(const CXXRecordDecl *R) { +bool hasPublicRefMethod(const CXXRecordDecl *R) { assert(R); assert(R->hasDefinition()); - bool hasRef = false; - bool hasDeref = false; for (const CXXMethodDecl *MD : R->methods()) { const auto MethodName = safeGetName(MD); + if (MethodName == "ref" && MD->getAccess() == AS_public) + return true; + } + return false; +} - if (MethodName == "ref" && MD->getAccess() == AS_public) { - if (hasDeref) - return true; - hasRef = true; - } else if (MethodName == "deref" && MD->getAccess() == AS_public) { - if (hasRef) - return true; - hasDeref = true; - } +bool hasPublicDerefMethod(const CXXRecordDecl *R) { ---------------- rniwa wrote:
Sure, done that. https://github.com/llvm/llvm-project/pull/68170 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits