Skip to content

Commit 3b84245

Browse files
committed
Change ClangImporter if check to an assertion
1 parent 056d498 commit 3b84245

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,13 +1524,13 @@ Type ClangImporter::Implementation::importFunctionReturnType(
15241524
DeclContext *dc,
15251525
const clang::FunctionDecl *clangDecl,
15261526
bool allowNSUIntegerAsInt) {
1527-
// CF function results can be managed if they are audited or
1527+
// CF function results can be managed if they are audited or
15281528
// the ownership convention is explicitly declared.
1529+
assert(clangDecl && "expected to have a decl to import");
15291530
bool isAuditedResult =
1530-
(clangDecl &&
1531-
(clangDecl->hasAttr<clang::CFAuditedTransferAttr>() ||
1532-
clangDecl->hasAttr<clang::CFReturnsRetainedAttr>() ||
1533-
clangDecl->hasAttr<clang::CFReturnsNotRetainedAttr>()));
1531+
(clangDecl->hasAttr<clang::CFAuditedTransferAttr>() ||
1532+
clangDecl->hasAttr<clang::CFReturnsRetainedAttr>() ||
1533+
clangDecl->hasAttr<clang::CFReturnsNotRetainedAttr>());
15341534

15351535
// Check if we know more about the type from our whitelists.
15361536
OptionalTypeKind OptionalityOfReturn;

0 commit comments

Comments
 (0)