Index: base/bit_cast.h |
diff --git a/base/bit_cast.h b/base/bit_cast.h |
index 42d08ee8190a0a499ff0e5a5260d7802f9873fc0..c9514bceef4d861f660aa200eaccc997c6588361 100644 |
--- a/base/bit_cast.h |
+++ b/base/bit_cast.h |
@@ -65,9 +65,11 @@ inline Dest bit_cast(const Source& source) { |
"bit_cast requires source and destination to be the same size"); |
#if (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) || \ |
- defined(_LIBCPP_VERSION)) |
+ (defined(__clang__) && defined(_LIBCPP_VERSION))) |
// GCC 5.1 contains the first libstdc++ with is_trivially_copyable. |
// Assume libc++ Just Works: is_trivially_copyable added on May 13th 2011. |
+ // However, with libc++ when GCC is the compiler the trait is buggy, see |
+ // crbug.com/607158, so fall back to the less strict variant for non-clang. |
static_assert(std::is_trivially_copyable<Dest>::value, |
"non-trivially-copyable bit_cast is undefined"); |
static_assert(std::is_trivially_copyable<Source>::value, |