File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
test/Interop/Cxx/reference Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -546,6 +546,12 @@ namespace {
546
546
return importFunctionPointerLikeType (*type, pointeeType);
547
547
}
548
548
549
+ // Currently, we can't generate thunks for references to dependent types
550
+ // because there's no way to cast without a copy (without writing the SIL
551
+ // manually).
552
+ if (pointeeQualType->isDependentType ())
553
+ return Type ();
554
+
549
555
if (Impl.isOverAligned (pointeeQualType)) {
550
556
return importOverAlignedFunctionPointerLikeType (*type, Impl);
551
557
}
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ void setConstStaticIntRvalueRef(const int &&);
16
16
auto getFuncRef () -> int (&)();
17
17
auto getFuncRvalueRef () -> int (&&)();
18
18
19
+ template <class T >
20
+ struct ClassTemplate {};
21
+
22
+ template <class T >
23
+ const ClassTemplate<T> &refToDependent () { return ClassTemplate<T>(); }
24
+
19
25
// We cannot import "_Atomic" types. Make sure we fail gracefully instead of
20
26
// crashing when we have an "_Atomic" type or a reference to one.
21
27
void dontImportAtomicRef (_Atomic(int )&) { }
Original file line number Diff line number Diff line change 13
13
// CHECK: func getFuncRef() -> @convention(c) () -> Int32
14
14
// CHECK: func getFuncRvalueRef() -> @convention(c) () -> Int32
15
15
16
+ // CHECK-NOT: refToDependent
16
17
// CHECK-NOT: dontImportAtomicRef
You can’t perform that action at this time.
0 commit comments