Files
swift-mirror/test/Interop/Cxx/class/Inputs/module.modulemap
John Hui 66c2e2c52b [cxx-interop] Import non-public inherited members (#79348)
This patch is follow-up work from #78942 and imports non-public members,
which were previously not being imported. Those members can be accessed
in a Swift file blessed by the SWIFT_PRIVATE_FILEID annotation.

As a consequence of this patch, we are also now importing inherited members
that are inaccessible from the derived classes, because they were declared
private, or because they were inherited via nested private inheritance. We
import them anyway but mark them unavailable, for better diagnostics and to
(somewhat) simplify the import logic for inheritance.

Because non-public base class members are now imported too, this patch
inflames an existing issue where a 'using' declaration on an inherited member
with a synthesized name (e.g., operators) produces duplicate members, leading
to miscompilation (resulting in a runtime crash). This was not previously noticed
because a 'using' declaration on a public inherited member is not usually
necessary, but is a common way to expose otherwise non-public members.
This patch puts in a workaround to prevent this from affecting the behavior
of MSVC's std::optional implementation, which uses this pattern of 'using'
a private inherited member. That will be fixed in a follow-up patch.

Follow-up work is also needed to correctly diagnose ambiguous overloads
in cases of multiple inheritance, and to account for virtual inheritance.

rdar://137764620
2025-02-25 01:03:16 -08:00

155 lines
2.5 KiB
Plaintext

module TypeClassification {
header "type-classification.h"
requires cplusplus
}
module Constructors {
header "constructors.h"
requires cplusplus
}
module ConstructorsObjC {
header "constructors-objc.h"
requires cplusplus
}
module CustomNewOperator {
header "custom-new-operator.h"
requires cplusplus
}
module Destructors {
header "destructors.h"
requires cplusplus
}
module DestructorsWithTemporaryValues {
header "destructors-with-temporary-values.h"
requires cplusplus
}
module Extensions {
header "extensions.h"
requires cplusplus
}
module LoadableTypes {
header "loadable-types.h"
requires cplusplus
}
module MemberwiseInitializer {
header "memberwise-initializer.h"
requires cplusplus
}
module MemoryLayout {
header "memory-layout.h"
requires cplusplus
}
module MemberVariables {
header "member-variables.h"
requires cplusplus
}
module MutableMembers {
header "mutable-members.h"
requires cplusplus
}
module MutabilityAnnotations {
header "mutability-annotations.h"
requires cplusplus
}
module NoDiscard {
header "nodiscard.h"
requires cplusplus
}
module ProtocolConformance {
header "protocol-conformance.h"
requires cplusplus
}
module Sendable {
header "sendable.h"
requires cplusplus
}
module StructuredBindingsGetMethod {
header "structured-bindings-get-method.h"
requires cplusplus
}
module SynthesizedInitializers {
header "synthesized-initializers.h"
requires cplusplus
}
module DebugInfo {
header "debug-info.h"
requires cplusplus
}
module NestedRecords {
header "nested-records.h"
requires cplusplus
}
module LinkedRecords {
header "linked-records.h"
requires cplusplus
}
module InvalidNestedStruct {
header "invalid-nested-struct.h"
requires cplusplus
}
module ClassProtocolNameClash {
header "class-protocol-name-clash.h"
requires cplusplus
}
module DictionaryOfNSStrings {
header "dictionary-of-nsstrings.h"
requires cplusplus
}
module ForwardDeclaredCxxRecord {
header "forward-declared-cxx-record.h"
requires cplusplus
}
module ReturnsLargeClass {
header "returns-large-class.h"
}
module ForwardDeclaredInNamespace {
header "forward-declared-in-namespace.h"
requires cplusplus
}
module ConformsTo {
header "conforms-to.h"
requires cplusplus
}
module CopyMoveAssignment {
header "copy-move-assignment.h"
requires cplusplus
}
module Closure {
header "closure.h"
requires cplusplus
}
module PIMPL {
header "pimpl.h"
requires cplusplus
export *
}