Files
swift-mirror/test/Interop/Cxx/class/access/non-public-shadow-executable.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

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()