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.

llvm-svn: 320733
This commit is contained in:
Zachary Turner 2017-12-14 19:11:28 +00:00
parent 2aaeeb40b3
commit 689c6960ef
1 changed files with 5 additions and 1 deletions

View File

@ -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<GloballyHashedType>::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<codeview::LocallyHashedType> {