From 5842df93dd3fd70ab1ca5ba9ed6b4010c233f330 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 30 Nov 2018 22:13:42 +0000 Subject: [PATCH] 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. llvm-svn: 348042 --- llvm/include/llvm/Support/type_traits.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h index 55d84f1..e7b8f251 100644 --- a/llvm/include/llvm/Support/type_traits.h +++ b/llvm/include/llvm/Support/type_traits.h @@ -30,9 +30,10 @@ namespace llvm { template struct isPodLike { // std::is_trivially_copyable is available in libc++ with clang, libstdc++ - // that comes with GCC 5. + // that comes with GCC 5. MSVC 2015 and newer also have + // std::is_trivially_copyable. #if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \ - (defined(__GNUC__) && __GNUC__ >= 5) + (defined(__GNUC__) && __GNUC__ >= 5) || defined(_MSC_VER) // If the compiler supports the is_trivially_copyable trait use it, as it // matches the definition of isPodLike closely. static const bool value = std::is_trivially_copyable::value; -- 2.7.4