Skip to content

Commit d026b10

Browse files
authored
Merge pull request #20118 from compnerd/silence
runtime: silence the compiler warning about const (NFC)
2 parents 7b5e83d + 185f923 commit d026b10

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stdlib/public/runtime/ExistentialMetadataImpl.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,17 @@ struct LLVM_LIBRARY_VISIBILITY OpaqueExistentialBox
330330
static constexpr bool isBitwiseTakable = true;
331331
static constexpr unsigned numExtraInhabitants =
332332
swift_getHeapObjectExtraInhabitantCount();
333-
333+
334334
static void storeExtraInhabitant(Container *dest, int index) {
335-
swift_storeHeapObjectExtraInhabitant((HeapObject**)&dest->Header.Type,
336-
index);
335+
swift_storeHeapObjectExtraInhabitant(
336+
const_cast<HeapObject **>(
337+
reinterpret_cast<const HeapObject **>(&dest->Header.Type)),
338+
index);
337339
}
338340

339341
static int getExtraInhabitantIndex(const Container *src) {
340-
return swift_getHeapObjectExtraInhabitantIndex(
341-
(HeapObject* const *)&src->Header.Type);
342+
return swift_getHeapObjectExtraInhabitantIndex(const_cast<HeapObject **>(
343+
reinterpret_cast<const HeapObject *const *>(&src->Header.Type)));
342344
}
343345
};
344346

0 commit comments

Comments
 (0)