Skip to content

Commit 5dc7c47

Browse files
committed
replace more matcher if statements with assertions
1 parent c868336 commit 5dc7c47

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ namespace {
1919

2020
AST_MATCHER(clang::QualType, isBuiltinInt) {
2121
const auto *BT = Node->getAs<clang::BuiltinType>();
22-
if (!BT)
23-
return false;
22+
assert(BT);
2423

2524
// BT->isInteger() would detect char and bool
2625
switch (BT->getKind()) {
@@ -40,8 +39,7 @@ AST_MATCHER(clang::QualType, isBuiltinInt) {
4039

4140
AST_MATCHER(clang::QualType, isBuiltinFloat) {
4241
const auto *BT = Node->getAs<clang::BuiltinType>();
43-
if (!BT)
44-
return false;
42+
assert(BT);
4543

4644
return BT->isFloatingPoint();
4745
}

0 commit comments

Comments
 (0)