From 349a3912081c9d9e7f5f065122fe0194cc26aa5a Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Wed, 10 May 2017 18:00:27 -0700 Subject: [PATCH] Removed unnecessary check for Offset in AssertScalarT() This will avoid it accidentally accepting structs of size 4. Change-Id: I251285ae1e4bffb859367dcf89562741a3980bba Tested: on Linux. --- include/flatbuffers/flatbuffers.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 198f7efc8..f89c4d62a 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -820,10 +820,7 @@ FLATBUFFERS_FINAL_CLASS template void AssertScalarT() { #ifndef FLATBUFFERS_CPP98_STL // The code assumes power of 2 sizes and endian-swap-ability. - static_assert(std::is_scalar::value - // The Offset type is essentially a scalar but fails is_scalar. - || sizeof(T) == sizeof(Offset), - "T must be a scalar type"); + static_assert(std::is_scalar::value, "T must be a scalar type"); #endif }