Skip to content

Commit 0e4f95e

Browse files
authored
Merge pull request swiftlang#22870 from compnerd/old-school-cool
2 parents f166af1 + 650ebeb commit 0e4f95e

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)