Skip to content

Commit 75450e5

Browse files
authored
Merge pull request #16472 from mikeash/silence-offsetof-warning
[Runtime] Silence warnings for offsetof usage on TupleCacheEntry.
2 parents 9aead6b + b821a2e commit 75450e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ class TupleCacheEntry
876876

877877
class TupleCache : public MetadataCache<TupleCacheEntry, false, TupleCache> {
878878
public:
879+
// FIXME: https://bugs.swift.org/browse/SR-1155
880+
#pragma clang diagnostic push
881+
#pragma clang diagnostic ignored "-Winvalid-offsetof"
879882
static TupleCacheEntry *
880883
resolveExistingEntry(const TupleTypeMetadata *metadata) {
881884
// The correctness of this arithmetic is verified by an assertion in
@@ -885,6 +888,7 @@ class TupleCache : public MetadataCache<TupleCacheEntry, false, TupleCache> {
885888
auto entry = reinterpret_cast<const TupleCacheEntry*>(bytes);
886889
return const_cast<TupleCacheEntry*>(entry);
887890
}
891+
#pragma clang diagnostic pop
888892
};
889893

890894
} // end anonymous namespace

0 commit comments

Comments
 (0)