Files
swift-mirror/test/Interop/CxxToSwiftToCxx/nested-cxx-class-back-to-swift.swift
Gábor Horváth 8e6daf75ec [6.2][cxx-interop] Fix a rare compilation error in reverse interop header
Explanation: Fix a compilation error in the generated reverse interop
header when a nested foreign type is used in a generic context and it is
reexposed to C++.
Issue: rdar://148597079
Risk: Low, the fix is fairly targeted to the affected scenario.
Testing: Added tests to test suite
Reviewer: @egorzhdan
2025-04-08 11:32:08 +01:00

28 lines
754 B
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-frontend %t/use-cxx-types.swift -module-name UseCxxTy -typecheck -verify -emit-clang-header-path %t/UseCxxTy.h -I %t -enable-experimental-cxx-interop -clang-header-expose-decls=all-public -disable-availability-checking
// RUN: cat %t/header.h >> %t/full-header.h
// RUN: cat %t/UseCxxTy.h >> %t/full-header.h
// RUN: %target-interop-build-clangxx -std=c++20 -c -xc++-header %t/full-header.h -o %t/o.o
//--- header.h
struct Cell { class Visitor {}; };
//--- module.modulemap
module CxxTest {
header "header.h"
requires cplusplus
}
//--- use-cxx-types.swift
import CxxTest
public extension Cell.Visitor {
func visit() {}
}
public func f() -> [Cell.Visitor] {
}