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 {
546546 return importFunctionPointerLikeType (*type, pointeeType);
547547 }
548548
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+
549555 if (Impl.isOverAligned (pointeeQualType)) {
550556 return importOverAlignedFunctionPointerLikeType (*type, Impl);
551557 }
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ void setConstStaticIntRvalueRef(const int &&);
1616auto getFuncRef () -> int (&)();
1717auto getFuncRvalueRef () -> int (&&)();
1818
19+ template <class T >
20+ struct ClassTemplate {};
21+
22+ template <class T >
23+ const ClassTemplate<T> &refToDependent () { return ClassTemplate<T>(); }
24+
1925// We cannot import "_Atomic" types. Make sure we fail gracefully instead of
2026// crashing when we have an "_Atomic" type or a reference to one.
2127void dontImportAtomicRef (_Atomic (int )&) { }
Original file line number Diff line number Diff line change 1313// CHECK: func getFuncRef() -> @convention(c) () -> Int32
1414// CHECK: func getFuncRvalueRef() -> @convention(c) () -> Int32
1515
16+ // CHECK-NOT: refToDependent
1617// CHECK-NOT: dontImportAtomicRef
You can’t perform that action at this time.
0 commit comments