From 616fe05fc3451590568ff8b33d55662c0d27c5b0 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 14 Mar 2018 13:12:11 -0700 Subject: Removed use of some type traits Pre-5.1.0 versions of GCC do not support these particular type traits (see https://github.com/google/protobuf/issues/417). --- src/google/protobuf/arena.h | 2 +- src/google/protobuf/generated_message_table_driven_lite.h | 6 +++--- src/google/protobuf/repeated_field.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index f286ada8..9928c8e6 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -333,7 +333,7 @@ class LIBPROTOBUF_EXPORT Arena { template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateArray( Arena* arena, size_t num_elements) { - static_assert(std::is_trivially_default_constructible::value, + static_assert(std::is_pod::value, "CreateArray requires a trivially constructible type"); static_assert(std::is_trivially_destructible::value, "CreateArray requires a trivially destructible type"); diff --git a/src/google/protobuf/generated_message_table_driven_lite.h b/src/google/protobuf/generated_message_table_driven_lite.h index b2c60968..0d90fe33 100644 --- a/src/google/protobuf/generated_message_table_driven_lite.h +++ b/src/google/protobuf/generated_message_table_driven_lite.h @@ -100,7 +100,7 @@ inline ExtensionSet* GetExtensionSet(MessageLite* msg, int64 extension_offset) { template inline Type* AddField(MessageLite* msg, int64 offset) { - static_assert(std::is_trivially_copy_assignable::value || + static_assert(std::is_pod::value || std::is_same::value, "Do not assign"); @@ -119,7 +119,7 @@ inline string* AddField(MessageLite* msg, int64 offset) { template inline void AddField(MessageLite* msg, int64 offset, Type value) { - static_assert(std::is_trivially_copy_assignable::value, + static_assert(std::is_pod::value, "Do not assign"); *AddField(msg, offset) = value; } @@ -141,7 +141,7 @@ inline Type* MutableField(MessageLite* msg, uint32* has_bits, template inline void SetField(MessageLite* msg, uint32* has_bits, uint32 has_bit_index, int64 offset, Type value) { - static_assert(std::is_trivially_copy_assignable::value, + static_assert(std::is_pod::value, "Do not assign"); *MutableField(msg, has_bits, has_bit_index, offset) = value; } diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index 80820c7a..b47ea994 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -351,7 +351,7 @@ namespace internal { // effectively. template ::value> + std::is_pod::value> struct ElementCopier { void operator()(Element* to, const Element* from, int array_size); }; -- cgit v1.2.3