Fixes part of PR#45815. Overriding methods should not get a readability-identifier-naming warning because the issue can only be fixed in the base class; but the current check for whether a method is overriding does not take the override attribute into account, which makes a difference for dependent base classes.
The other issue mentioned in PR#45815 is not solved by this patch: Applying the fix provided by readability-identifier-naming only changes the name in the base class, not in the derived class(es) or at any call sites. This is difficult to fix, because in addition to the template base class, there could be specializations of the base class that also contain the overridden method, which is why applying the fix from the base class in the derived class in general would not lead to correct code.
Adding a call to hasAttr<OverrideAttr>() looks OK to me -- this is in line with AST_MATCHER(CXXMethodDecl, isOverride). Other clang-tidy checks have done the same thing.