[base] Remove special-casing for gcc < 5

Node now requires gcc >=6.3, and we do not test on gcc <5.4 any more.
Thus remove a special case for gcc <5.

R=machenbach@chromium.org

Bug: v8:9686
Change-Id: Ifffddec611c15b704aa292a65e87cd770d85ea7b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1786283
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63572}
This commit is contained in:
Clemens Hammacher 2019-09-05 11:14:38 +02:00 committed by Commit Bot
parent 00061793b0
commit 26b3649695

View File

@ -232,35 +232,16 @@ struct is_trivially_copyable {
// the standard does not, so let's skip this check.)
// Trivial non-deleted destructor.
std::is_trivially_destructible<T>::value;
#elif defined(__GNUC__) && __GNUC__ < 5
// WARNING:
// On older libstdc++ versions, there is no way to correctly implement
// is_trivially_copyable. The workaround below is an approximation (neither
// over- nor underapproximation). E.g. it wrongly returns true if the move
// constructor is non-trivial, and it wrongly returns false if the copy
// constructor is deleted, but copy assignment is trivial.
// TODO(rongjie) Remove this workaround once we require gcc >= 5.0
static constexpr bool value =
__has_trivial_copy(T) && __has_trivial_destructor(T);
#else
static constexpr bool value = std::is_trivially_copyable<T>::value;
#endif
};
#if defined(__GNUC__) && __GNUC__ < 5
// On older libstdc++ versions, base::is_trivially_copyable<T>::value is only an
// approximation (see above), so make ASSERT_{NOT_,}TRIVIALLY_COPYABLE a noop.
#define ASSERT_TRIVIALLY_COPYABLE(T) static_assert(true, "check disabled")
#define ASSERT_NOT_TRIVIALLY_COPYABLE(T) static_assert(true, "check disabled")
#else
#define ASSERT_TRIVIALLY_COPYABLE(T) \
static_assert(::v8::base::is_trivially_copyable<T>::value, \
#T " should be trivially copyable")
#define ASSERT_NOT_TRIVIALLY_COPYABLE(T) \
static_assert(!::v8::base::is_trivially_copyable<T>::value, \
#T " should not be trivially copyable")
#endif
// The USE(x, ...) template is used to silence C++ compiler warnings
// issued for (yet) unused variables (typically parameters).