Skip to content

Commit c0a301e

Browse files
committed
fix build: mute warning in detached_tasks_sync_block.cpp for clang
commit_hash:1f7d21182283e88d01f4a56af248f59c3664de78
1 parent 6c1da8c commit c0a301e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

core/src/engine/impl/detached_tasks_sync_block.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ struct DetachedTasksSyncBlock::Token final : public PolymorphicAwaiter {
4848
// Token is non-standard-layout type, because it is a polymorphic class.
4949
// GCC complains that compilers are not required to implement offsetof for such types.
5050
// TODO Find some way to work around that, e.g. split Token into multiple types?
51-
#if defined(__GNUC__) && !defined(__clang__)
51+
#if defined(__clang__)
52+
#pragma clang diagnostic push
53+
#pragma clang diagnostic ignored "-Winvalid-offsetof"
54+
#elif defined(__GNUC__)
5255
#pragma GCC diagnostic push
5356
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
5457
#endif
@@ -63,7 +66,9 @@ struct DetachedTasksSyncBlock::Impl final {
6366
std::atomic<TaskCancellationReason> cancel_new_tasks{TaskCancellationReason::kNone};
6467
};
6568

66-
#if defined(__GNUC__) && !defined(__clang__)
69+
#if defined(__clang__)
70+
#pragma clang diagnostic pop
71+
#elif defined(__GNUC__)
6772
#pragma GCC diagnostic pop
6873
#endif
6974

0 commit comments

Comments
 (0)