Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 39cd630

Browse files
committed
Support: use std::is_trivially_copyable on MSVC
MSVC 2015 and newer have std::is_trivially_copyable available for use. We should prefer that over the std::is_class to get this check be correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348042 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7534620 commit 39cd630

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/llvm/Support/type_traits.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ namespace llvm {
3030
template <typename T>
3131
struct isPodLike {
3232
// std::is_trivially_copyable is available in libc++ with clang, libstdc++
33-
// that comes with GCC 5.
33+
// that comes with GCC 5. MSVC 2015 and newer also have
34+
// std::is_trivially_copyable.
3435
#if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \
35-
(defined(__GNUC__) && __GNUC__ >= 5)
36+
(defined(__GNUC__) && __GNUC__ >= 5) || defined(_MSC_VER)
3637
// If the compiler supports the is_trivially_copyable trait use it, as it
3738
// matches the definition of isPodLike closely.
3839
static const bool value = std::is_trivially_copyable<T>::value;

0 commit comments

Comments
 (0)