Skip to content

Commit 1ffe3eb

Browse files
authored
Merge pull request #61599 from al45tair/eng/PR-101240198
Add workaround for implicit copy constructor generation problem.
2 parents f41deb0 + fb092d9 commit 1ffe3eb

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)