Skip to content

Commit 75a1daa

Browse files
committed
Revert changes outside of ClangTypeImporter
1 parent 4aa002b commit 75a1daa

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ static ImportedType adjustTypeForConcreteImport(
16691669
// optional type.
16701670
bool isIUO = false;
16711671
if (importKind != ImportTypeKind::Typedef && optKind != OTK_None &&
1672-
canImportAsOptional(hint) && !importedType->isForeignReferenceType()) {
1672+
canImportAsOptional(hint)) {
16731673
isIUO = optKind == OTK_ImplicitlyUnwrappedOptional;
16741674
importedType = OptionalType::get(importedType);
16751675
}
@@ -2739,8 +2739,7 @@ ParameterList *ClangImporter::Implementation::importFunctionParameterList(
27392739

27402740
bool knownNonNull = !nonNullArgs.empty() && nonNullArgs[index];
27412741
// Specialized templates need to match the args/result exactly.
2742-
/*knownNonNull |= clangDecl->isFunctionTemplateSpecialization();*/
2743-
// FIXME: for CI test, DO NOT MERGE ME
2742+
knownNonNull |= clangDecl->isFunctionTemplateSpecialization();
27442743

27452744
// Check nullability of the parameter.
27462745
OptionalTypeKind optionalityOfParam =

test/Interop/Cxx/templates/template-instantiation-irgen.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ func takesPtrToStruct(x: UnsafePointer<PlainStruct>) { takesValue(x) }
3232
func takesPtrToClass(x: UnsafePointer<CxxClass>) { takesValue(x) }
3333
// CHECK: define {{.*}} void @{{.*}}takesPtrToClass{{.*}}
3434

35-
func takesPtrToFRT(x: UnsafePointer<FRT>) { takesValue(x) }
36-
// CHECK: define {{.*}} void @{{.*}}takesPtrToFRT{{.*}}
35+
// TODO: this does not work because this round-trips to UnsafePointer<FRT?>
36+
// func takesPtrToFRT(x: UnsafePointer<FRT>) { takesValue(x) }
3737

3838
func takesMutPtrToStruct(x: UnsafeMutablePointer<PlainStruct>) { takesValue(x) }
3939
// CHECK: define {{.*}} void @{{.*}}takesMutPtrToStruct{{.*}}
4040

4141
func takesMutPtrToClass(x: UnsafeMutablePointer<CxxClass>) { takesValue(x) }
4242
// CHECK: define {{.*}} void @{{.*}}takesMutPtrToClass{{.*}}
4343

44-
func takesMutPtrToFRT(x: UnsafeMutablePointer<FRT>) { takesValue(x) }
45-
// CHECK: define {{.*}} void @{{.*}}takesMutPtrToFRT{{.*}}
44+
// TODO: this does not work because this round-trips to UnsafeMutablePointer<FRT?>
45+
// func takesMutPtrToFRT(x: UnsafeMutablePointer<FRT>) { takesValue(x) }
4646

4747
// TODO: optional pointers are not yet supported but they should be
4848
// func takesCPtr() { takesValue(intPtr) }

0 commit comments

Comments
 (0)