Skip to content

Commit 650ebeb

Browse files
committed
ABI: use a c-style cast in the header (NFC)
Use a C-style cast to appease cl depending on the template type parameters used. It does not like a reinterpret_cast between integral types.
1 parent f2c3c69 commit 650ebeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/ABI/Metadata.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,11 @@ class TargetProtocolDescriptorRef {
16451645
assert(!isObjC());
16461646
#endif
16471647

1648-
return reinterpret_cast<ProtocolDescriptorPointer>(storage & ~IsObjCBit);
1648+
// NOTE: we explicitly use a C-style cast here because cl objects to the
1649+
// reinterpret_cast from a uintptr_t type to an unsigned type which the
1650+
// Pointer type may be depending on the instantiation. Using the C-style
1651+
// cast gives us a single path irrespective of the template type parameters.
1652+
return (ProtocolDescriptorPointer)(storage & ~IsObjCBit);
16491653
}
16501654

16511655
/// Retrieve the raw stored pointer and discriminator bit.

0 commit comments

Comments
 (0)