Skip to content

Commit ec10c5f

Browse files
[SwiftToCxx] Adding _Nullable to avoid warnings
1 parent 17ae635 commit ec10c5f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/PrintAsClang/PrintClangFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ ClangRepresentation DeclAndTypeClangFunctionPrinter::printFunctionSignature(
475475
}
476476
} else if (param.role == AdditionalParam::Role::Error) {
477477
os << "SWIFT_ERROR_RESULT ";
478-
os << "void ** _error";
478+
os << "void * _Nullable * _Nullable _error";
479479
} else if (param.role == AdditionalParam::Role::GenericRequirement) {
480480
os << "void * _Nonnull ";
481481
if (param.genericRequirement->Protocol)

test/Interop/SwiftToCxx/functions/swift-functions-errors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
// CHECK-LABEL: namespace _impl {
1010

11-
// CHECK: SWIFT_EXTERN void $s9Functions18emptyThrowFunctionyyKF(SWIFT_CONTEXT void * _Nonnull _self, SWIFT_ERROR_RESULT void ** _error) SWIFT_CALL; // emptyThrowFunction()
12-
// CHECK: SWIFT_EXTERN void $s9Functions13throwFunctionyyKF(SWIFT_CONTEXT void * _Nonnull _self, SWIFT_ERROR_RESULT void ** _error) SWIFT_CALL; // throwFunction()
11+
// CHECK: SWIFT_EXTERN void $s9Functions18emptyThrowFunctionyyKF(SWIFT_CONTEXT void * _Nonnull _self, SWIFT_ERROR_RESULT void * _Nullable * _Nullable _error) SWIFT_CALL; // emptyThrowFunction()
12+
// CHECK: SWIFT_EXTERN void $s9Functions13throwFunctionyyKF(SWIFT_CONTEXT void * _Nonnull _self, SWIFT_ERROR_RESULT void * _Nullable * _Nullable _error) SWIFT_CALL; // throwFunction()
1313

1414
// CHECK: }
1515

0 commit comments

Comments
 (0)