Skip to content

Commit fb092d9

Browse files
committed
Add workaround for implicit copy constructor generation problem.
Some versions of Clang seem to generate a non-working implicit copy constructor for `RemoteRef<BuiltinTypeDescriptor>`, which results in all the reflection tests failing. Fix by declaring it explicitly. rdar://101240198
1 parent 7c3a63b commit fb092d9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/swift/Remote/MetadataReader.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,21 @@ class RemoteRef {
7070
explicit RemoteRef(StoredPointer address, const T *localBuffer)
7171
: Address((uint64_t)address), LocalBuffer(localBuffer) {}
7272

73+
// <rdar://99715218> Some versions of clang++ sometimes fail to generate the
74+
// copy constructor for this type correctly - add a workaround
75+
RemoteRef(const RemoteRef &other)
76+
: Address(other.Address), LocalBuffer(other.LocalBuffer) {}
77+
78+
RemoteRef& operator=(const RemoteRef &other) {
79+
Address = other.Address;
80+
LocalBuffer = other.LocalBuffer;
81+
return *this;
82+
}
83+
7384
uint64_t getAddressData() const {
7485
return Address;
7586
}
76-
87+
7788
const T *getLocalBuffer() const {
7889
return LocalBuffer;
7990
}

0 commit comments

Comments
 (0)