From: Zachary Turner Date: Thu, 14 Dec 2017 19:11:28 +0000 (+0000) Subject: Only use is_trivially_copyable if we know it's safe to do so. X-Git-Tag: android-x86-7.1-r4~7215 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b9a44ec3ca3f9d5cfb01bbcd64a0e015e05aaaa3;p=android-x86%2Fexternal-llvm.git Only use is_trivially_copyable if we know it's safe to do so. Apparently this isn't present on older versions of libstdc++, so it causes some builds to fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320733 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/DebugInfo/CodeView/TypeHashing.h b/include/llvm/DebugInfo/CodeView/TypeHashing.h index af7af05ac2d..74133753370 100644 --- a/include/llvm/DebugInfo/CodeView/TypeHashing.h +++ b/include/llvm/DebugInfo/CodeView/TypeHashing.h @@ -132,11 +132,15 @@ struct GloballyHashedType { return Hashes; } }; +#if defined(_MSC_VER) +// is_trivially_copyable is not available in older versions of libc++, but it is +// available in all supported versions of MSVC, so at least this gives us some +// coverage. static_assert(std::is_trivially_copyable::value, "GloballyHashedType must be trivially copyable so that we can " "reinterpret_cast arrays of hash data to arrays of " "GloballyHashedType"); - +#endif } // namespace codeview template <> struct DenseMapInfo {