[clang-tidy] Fix minor style issues. NFC
llvm-svn: 259198
This commit is contained in:
parent
8ac20a8439
commit
bfee5f7352
|
|
@ -168,9 +168,8 @@ static bool checkOverrideByDerivedMethod(const CXXMethodDecl *BaseMD,
|
||||||
E = DerivedMD->end_overridden_methods();
|
E = DerivedMD->end_overridden_methods();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
const CXXMethodDecl *OverriddenMD = *I;
|
const CXXMethodDecl *OverriddenMD = *I;
|
||||||
if (BaseMD->getCanonicalDecl() == OverriddenMD->getCanonicalDecl()) {
|
if (BaseMD->getCanonicalDecl() == OverriddenMD->getCanonicalDecl())
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ namespace {
|
||||||
// The subtelty is that in some cases (user defined conversions), we can
|
// The subtelty is that in some cases (user defined conversions), we can
|
||||||
// get to ImplicitCastExpr inside each other, with the outer one a NoOp. In this
|
// get to ImplicitCastExpr inside each other, with the outer one a NoOp. In this
|
||||||
// case we skip the first cast expr.
|
// case we skip the first cast expr.
|
||||||
bool IsNonTrivialImplicitCast(const Stmt* ST) {
|
bool IsNonTrivialImplicitCast(const Stmt *ST) {
|
||||||
if (const auto* ICE = dyn_cast<ImplicitCastExpr>(ST)) {
|
if (const auto *ICE = dyn_cast<ImplicitCastExpr>(ST)) {
|
||||||
return (ICE->getCastKind() != CK_NoOp) ||
|
return (ICE->getCastKind() != CK_NoOp) ||
|
||||||
IsNonTrivialImplicitCast(ICE->getSubExpr());
|
IsNonTrivialImplicitCast(ICE->getSubExpr());
|
||||||
}
|
}
|
||||||
|
|
@ -57,15 +57,15 @@ void ImplicitCastInLoopCheck::registerMatchers(MatchFinder *Finder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImplicitCastInLoopCheck::check(const MatchFinder::MatchResult &Result) {
|
void ImplicitCastInLoopCheck::check(const MatchFinder::MatchResult &Result) {
|
||||||
const auto* VD = Result.Nodes.getNodeAs<VarDecl>("faulty-var");
|
const auto *VD = Result.Nodes.getNodeAs<VarDecl>("faulty-var");
|
||||||
const auto* Init = Result.Nodes.getNodeAs<Expr>("init");
|
const auto *Init = Result.Nodes.getNodeAs<Expr>("init");
|
||||||
const auto* OperatorCall =
|
const auto *OperatorCall =
|
||||||
Result.Nodes.getNodeAs<CXXOperatorCallExpr>("operator-call");
|
Result.Nodes.getNodeAs<CXXOperatorCallExpr>("operator-call");
|
||||||
|
|
||||||
if (const auto* Cleanup = dyn_cast<ExprWithCleanups>(Init))
|
if (const auto *Cleanup = dyn_cast<ExprWithCleanups>(Init))
|
||||||
Init = Cleanup->getSubExpr();
|
Init = Cleanup->getSubExpr();
|
||||||
|
|
||||||
const auto* Materialized = dyn_cast<MaterializeTemporaryExpr>(Init);
|
const auto *Materialized = dyn_cast<MaterializeTemporaryExpr>(Init);
|
||||||
if (!Materialized)
|
if (!Materialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue