summaryrefslogtreecommitdiffstats
path: root/src/common/parent_of_member.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/parent_of_member.h')
-rw-r--r--src/common/parent_of_member.h3
1 files changed, 2 insertions, 1 deletions
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<ptrdiff_t>(static_cast<size_t>(next - start) * sizeof(MemberType) +
+ Offset);
}
static constexpr std::ptrdiff_t OffsetOf(MemberType ParentType::*member) {