From 0aff3ba2ffd00d3bc605d468d70815731a7ec6b0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 10 May 2021 08:06:19 -0400 Subject: parent_of_member: Make sign conversion explicit in OffsetOfImpl() Previously these conversions were implicit and causing quite a few warnings on clang. --- src/common/parent_of_member.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/common/parent_of_member.h b/src/common/parent_of_member.h index e0f8ab5c8..58c70b0e7 100644 --- a/src/common/parent_of_member.h +++ b/src/common/parent_of_member.h @@ -109,7 +109,8 @@ struct OffsetOfCalculator { } } - return (next - start) * sizeof(MemberType) + Offset; + return static_cast(static_cast(next - start) * sizeof(MemberType) + + Offset); } static constexpr std::ptrdiff_t OffsetOf(MemberType ParentType::*member) { -- cgit v1.2.3