[clang-tidy][NFC] Prefer isa<T> over T::classof (#172772)
We overwhelmingly prefer `isa` already, and I would argue it's more readable.
This commit is contained in:
parent
8a0cdb88f9
commit
686c2a1476
@ -17,7 +17,7 @@ namespace {
|
||||
AST_MATCHER(SwitchStmt, hasDefaultCase) {
|
||||
const SwitchCase *Case = Node.getSwitchCaseList();
|
||||
while (Case) {
|
||||
if (DefaultStmt::classof(Case))
|
||||
if (isa<DefaultStmt>(Case))
|
||||
return true;
|
||||
|
||||
Case = Case->getNextSwitchCase();
|
||||
|
||||
@ -17,7 +17,7 @@ namespace clang::tidy::cppcoreguidelines {
|
||||
namespace {
|
||||
AST_MATCHER(LambdaExpr, hasCoroutineBody) {
|
||||
const Stmt *Body = Node.getBody();
|
||||
return Body != nullptr && CoroutineBodyStmt::classof(Body);
|
||||
return Body != nullptr && isa<CoroutineBodyStmt>(Body);
|
||||
}
|
||||
|
||||
AST_MATCHER(LambdaExpr, hasCaptures) { return Node.capture_size() != 0U; }
|
||||
|
||||
@ -30,7 +30,7 @@ DiagnosticBuilder NoexceptMoveConstructorCheck::reportMissingNoexcept(
|
||||
return diag(FuncDecl->getLocation(),
|
||||
"move %select{assignment operator|constructor}0s should "
|
||||
"be marked noexcept")
|
||||
<< CXXConstructorDecl::classof(FuncDecl);
|
||||
<< isa<CXXConstructorDecl>(FuncDecl);
|
||||
}
|
||||
|
||||
void NoexceptMoveConstructorCheck::reportNoexceptEvaluatedToFalse(
|
||||
@ -38,7 +38,7 @@ void NoexceptMoveConstructorCheck::reportNoexceptEvaluatedToFalse(
|
||||
diag(NoexceptExpr->getExprLoc(),
|
||||
"noexcept specifier on the move %select{assignment "
|
||||
"operator|constructor}0 evaluates to 'false'")
|
||||
<< CXXConstructorDecl::classof(FuncDecl);
|
||||
<< isa<CXXConstructorDecl>(FuncDecl);
|
||||
}
|
||||
|
||||
} // namespace clang::tidy::performance
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user