swift icon indicating copy to clipboard operation
swift copied to clipboard

[cxx-interop] Fix access check for nested private C++ enums

Open j-hui opened this issue 9 months ago • 1 comments

This patch fixes the access check for nested private C++ enums to look for the SWIFT_PRIVATE_FILEID of the enclosing C++ class, if any. Previously, the check was looking at for SWIFT_PRIVATE_FILEID on the enum decl itself (which is meaningless); that prevented nested private enum members from being accessible in Swift.

This patch also specializes the type signature of getPrivateFileIDAttrs to clarify the fact that SWIFT_PRIVATE_FILEID is not a meaningful annotation on anything other than CXXRecordDecl, because that is the only kind of decl that can assign access specifiers to its members.

rdar://148081340

j-hui avatar Mar 28 '25 07:03 j-hui

@swift-ci please test

j-hui avatar Mar 28 '25 07:03 j-hui

@swift-ci please test

j-hui avatar Mar 29 '25 18:03 j-hui

@swift-ci please test

j-hui avatar Mar 31 '25 16:03 j-hui

@swift-ci please test

j-hui avatar Mar 31 '25 21:03 j-hui

@swift-ci please test windows platform

j-hui avatar Mar 31 '25 23:03 j-hui

@swift-ci please test macos platform

j-hui avatar Apr 01 '25 04:04 j-hui