mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
5 lines
104 B
Plaintext
5 lines
104 B
Plaintext
module AnonymousUnionPartlyInvalid {
|
|
header "anonymous-union-partly-invalid.h"
|
|
requires cplusplus
|
|
}
|