Skip to content

Commit 504f6ce

Browse files
authored
[clang-tidy][NFC] clean readability-use-std-min-max (#122288)
1. add `static` for internal linkage functions 2. remove `clang` prefix for `QualType`
1 parent c1c50c7 commit 504f6ce

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

clang-tools-extra/clang-tidy/readability/UseStdMinMaxCheck.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static bool maxCondition(const BinaryOperator::Opcode Op, const Expr *CondLhs,
5959
return false;
6060
}
6161

62-
QualType getNonTemplateAlias(QualType QT) {
62+
static QualType getNonTemplateAlias(QualType QT) {
6363
while (true) {
6464
// cast to a TypedefType
6565
if (const TypedefType *TT = dyn_cast<TypedefType>(QT)) {
@@ -92,15 +92,15 @@ static std::string createReplacement(const Expr *CondLhs, const Expr *CondRhs,
9292
const llvm::StringRef AssignLhsStr = Lexer::getSourceText(
9393
Source.getExpansionRange(AssignLhs->getSourceRange()), Source, LO);
9494

95-
clang::QualType GlobalImplicitCastType;
96-
clang::QualType LhsType = CondLhs->getType()
97-
.getCanonicalType()
98-
.getNonReferenceType()
99-
.getUnqualifiedType();
100-
clang::QualType RhsType = CondRhs->getType()
101-
.getCanonicalType()
102-
.getNonReferenceType()
103-
.getUnqualifiedType();
95+
QualType GlobalImplicitCastType;
96+
QualType LhsType = CondLhs->getType()
97+
.getCanonicalType()
98+
.getNonReferenceType()
99+
.getUnqualifiedType();
100+
QualType RhsType = CondRhs->getType()
101+
.getCanonicalType()
102+
.getNonReferenceType()
103+
.getUnqualifiedType();
104104
if (LhsType != RhsType) {
105105
GlobalImplicitCastType = getNonTemplateAlias(BO->getLHS()->getType());
106106
}

0 commit comments

Comments
 (0)