mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This commit removes the guardrails in ImportDecl.cpp:SwiftDeclConverter that prevent it from importing non-public C++ members. It also accordingly adjusts all code that assumes generated Swift decls should be public. This commit does not import non-public inherited members; that needs its own follow-up patch. Note that Swift enforces stricter invariants about access levels than C++. For instance, public typealiases cannot be assigned private underlying types, and public functions cannot take or return private types. Meanwhile, both of these patterns are supported in C++, where exposing private types from a class's public interface is considered feature. As far as I am aware, Swift was already importing such private-containing public decls from C++ already, but I added a test suite, access inversion, that checks and documents this scenario, to ensure that it doesn't trip any assertions.
31 KiB
31 KiB