Files
swift-mirror/test/Interop/Cxx/union/Inputs/module.modulemap
Puyan Lotfi 7d7a6c6bcc [cxx-interop] Detect IndirectFields nested in non-importable anon-unions
This patch to the Clang Importer avoids an assert by detecting when an
IndirectField belongs to an anonymous union that is not importable. How
it does this is by determining if an IndirectFieldDecl's anonymous
parent field is non-importable (based on isCxxRecordImportable) and if
so skips importing the IndirectFieldDecl.

This avoids the mentioned assert because makeIndirectFieldAccessors
expects a FieldDecl of __Unnamed_union___Anonymous_field that is only
populated when the top-level union is imported from an
IndirectFieldDecl's parent. IndirectFieldDecls for the members of an
anonymous union are dependent on their parent and should not be imported
if their parent can not also be imported.

This corner case can happen in cases when an anonymous union contains an
ARC pointer, which results in a non-trivial but also inaccessible dtor.
2021-05-13 07:31:33 -10:00

5 lines
104 B
Plaintext

module AnonymousUnionPartlyInvalid {
header "anonymous-union-partly-invalid.h"
requires cplusplus
}