Skip to content

Commit e4f9a80

Browse files
jj-marrvbvictorEugeneZelenko
authored
Apply suggestions from code review
Co-authored-by: Baranov Victor <[email protected]> Co-authored-by: EugeneZelenko <[email protected]>
1 parent 87fbe9d commit e4f9a80

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang-tools-extra/clang-tidy/portability/AvoidPlatformSpecificFundamentalTypesCheck.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,11 @@ void AvoidPlatformSpecificFundamentalTypesCheck::registerMatchers(
133133
void AvoidPlatformSpecificFundamentalTypesCheck::check(
134134
const MatchFinder::MatchResult &Result) {
135135
const auto *TL = Result.Nodes.getNodeAs<TypeLoc>("type");
136-
if (!TL)
137-
return;
136+
assert(TL);
138137

139-
SourceLocation Loc = TL->getBeginLoc();
140-
QualType QT = TL->getType();
141-
SourceRange TypeRange = TL->getSourceRange();
138+
const SourceLocation Loc = TL->getBeginLoc();
139+
const QualType QT = TL->getType();
140+
const SourceRange TypeRange = TL->getSourceRange();
142141

143142
// Skip implicit type locations, such as literals
144143
if (!Loc.isValid() || !TypeRange.isValid())
@@ -175,7 +174,7 @@ void AvoidPlatformSpecificFundamentalTypesCheck::check(
175174
<< TypeName;
176175
} else {
177176
diag(Loc, "avoid using platform-dependent fundamental integer type '%0'; "
178-
"consider using a 'typedef' or fixed-width type instead")
177+
"consider using a type alias or fixed-width type instead")
179178
<< TypeName;
180179
}
181180
}

0 commit comments

Comments
 (0)