Intel compiler: ifdef out an incorrectly evaluated is_pod type trait

This commit is contained in:
Chuck Atkins 2020-02-11 10:21:44 -05:00 committed by Adam Cozzette
parent 06ae5d8042
commit 8312c36567

View File

@ -338,8 +338,10 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
template <typename T>
PROTOBUF_ALWAYS_INLINE static T* CreateArray(Arena* arena,
size_t num_elements) {
#ifndef __INTEL_COMPILER // icc mis-evaluates some types as non-pod
static_assert(std::is_pod<T>::value,
"CreateArray requires a trivially constructible type");
#endif
static_assert(std::is_trivially_destructible<T>::value,
"CreateArray requires a trivially destructible type");
GOOGLE_CHECK_LE(num_elements, std::numeric_limits<size_t>::max() / sizeof(T))