diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index da8aad013..c133a532d 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -562,6 +562,8 @@ struct hb_bytes_t template struct hb_array_t { + static_assert ((bool) (unsigned) hb_static_size (Type), ""); + inline hb_array_t (void) : arrayZ (nullptr), len (0) {} inline hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {} diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 17bc9c5b4..1c7b738be 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -345,6 +345,8 @@ static inline Type& operator + (Base &base, OffsetTo template struct UnsizedArrayOf { + static_assert ((bool) (unsigned) hb_static_size (Type), ""); + enum { item_size = Type::static_size }; HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (UnsizedArrayOf, Type); @@ -449,6 +451,8 @@ struct UnsizedOffsetListOf : UnsizedOffsetArrayOf template struct ArrayOf { + static_assert ((bool) (unsigned) hb_static_size (Type), ""); + enum { item_size = Type::static_size }; HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOf, Type, LenType); diff --git a/src/hb-vector.hh b/src/hb-vector.hh index 926f00544..c1d7f946a 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -34,6 +34,8 @@ template struct hb_vector_t { + static_assert ((bool) (unsigned) hb_static_size (Type), ""); + typedef Type ItemType; enum { item_size = sizeof (Type) };