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
24 lines
756 B
Swift
24 lines
756 B
Swift
// Check that we are resolving the correct member for all unambiguous members
|
|
// in the Shadow struct.
|
|
|
|
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -cxx-interoperability-mode=default -enable-experimental-feature ImportNonPublicCxxMembers)
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: swift_feature_ImportNonPublicCxxMembers
|
|
|
|
import StdlibUnittest
|
|
import NonPublicShadow
|
|
|
|
var Tests = TestSuite("NonPublicShadow")
|
|
|
|
Tests.test("Check return values") {
|
|
var s = Shadow()
|
|
|
|
expectEqual(s.publOrPriv(), Return.Publ_publOrPriv)
|
|
|
|
expectEqual(s.publPublShadowed(), Return.Shadow_publPublShadowed)
|
|
expectEqual(s.protPublShadowed(), Return.Shadow_protPublShadowed)
|
|
expectEqual(s.privPublShadowed(), Return.Shadow_privPublShadowed)
|
|
}
|
|
|
|
runAllTests()
|