mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ClangImporter can now import non-public members as ofbe73254cdcand66c2e2c52b, 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 inbdf22948cecan enable this flag to opt into importing private members they wish to access from Swift. rdar://145569473
29 lines
1.5 KiB
Swift
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: }
|