================
@@ -30,6 +30,15 @@ bool hasPublicMethodInBaseClass(const CXXRecordDecl *R, 
StringRef NameToMatch) {
     if (MethodName == NameToMatch && MD->getAccess() == AS_public)
       return true;
   }
+
+  for (const Decl *D : R->decls()) {
+    const auto *Shadow = dyn_cast<UsingShadowDecl>(D);
+    if (!Shadow || Shadow->getAccess() != AS_public)
+      continue;
+    const auto *MD = dyn_cast_or_null<CXXMethodDecl>(Shadow->getTargetDecl());
----------------
steakhal wrote:

I think `Shadow->getTargetDecl()` can never be null:

```suggestion
    const auto *MD = dyn_cast<CXXMethodDecl>(Shadow->getTargetDecl());
```

https://github.com/llvm/llvm-project/pull/223902
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to