Files
swift-mirror/test/Interop/Cxx/class/access/non-public-shadow-module-interface.swift
John Hui edc742013d [cxx-interop] Make experimental flag ImportNonPublicCxxMembers (#79728)
ClangImporter can now import non-public members as of be73254cdc and 66c2e2c52b, but doing so triggers some latent ClangImporter bugs in projects that don't use or need those non-public members.

This patch introduces a new experimental feature flag, ImportNonPublicCxxMembers, that guards against the importation of non-public members while we iron out those latent issues. Adopters of the SWIFT_PRIVATE_FILEID feature introduced in bdf22948ce can enable this flag to opt into importing private members they wish to access from Swift.

rdar://145569473
2025-03-04 13:31:46 -05:00

29 lines
1.5 KiB
Swift

// RUN: %target-swift-ide-test -print-module -module-to-print=NonPublicShadow -print-access -I %S/Inputs -source-filename=x -cxx-interoperability-mode=default -enable-experimental-feature ImportNonPublicCxxMembers | %FileCheck %s
// REQUIRES: swift_feature_ImportNonPublicCxxMembers
// We only check the module interface of Shadow to keep this test concise
// CHECK: public struct Shadow {
// CHECK-NEXT: public init()
// CHECK-NEXT: public func publPublShadowed() -> Return
// CHECK-NEXT: public func protPublShadowed() -> Return
// CHECK-NEXT: public func privPublShadowed() -> Return
// CHECK-NEXT: private func publPrivShadowed() -> Return
// CHECK-NEXT: private func protPrivShadowed() -> Return
// CHECK-NEXT: private func privPrivShadowed() -> Return
// Currently, ImportDecl.cpp::loadAllMembersOfRecordDecl() does not correctly
// handle multiple inheritance, so it only loads one of each ambiguous member.
// TODO: public func publOrPriv() -> Return
// TODO: @available(*, unavailable, message: "this base member is not accessible because it is private")
// TODO: private func publOrPriv() -> Return
// TODO: private func protOrPriv() -> Return
// TODO: @available(*, unavailable, message: "this base member is not accessible because it is private")
// TODO: private func protOrPriv() -> Return
// TODO: public func publOrProt() -> Return
// TODO: private func publOrProt() -> Return
// CHECK: }