Commit 2014e7b9 by Nicolas Capens Committed by Nicolas Capens

Work around std::is_trivially_copyable issue with MSVC

Microsoft Visual Studio Community 2019 Version 16.7.1 produced the following errors: C2976 'llvm::SmallVectorTemplateBase': too few template argument SwiftShader\third_party\llvm-10.0\llvm\include\llvm\ADT\SmallVector.h:315 C2338 inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable SwiftShader\third_party\llvm-10.0\llvm\include\llvm\Support\type_traits.h:181 Not defining LLVM's HAVE_STD_IS_TRIVIALLY_COPYABLE config makes it fall back to code which doesn't use std::is_trivially_copyable and avoids the issue. Note this may hide a potentially serious MSVC compiler bug since C2338 is produced by a static_assert. Without that static assert we may not have known about the unexpected std::is_trivially_copyable behavior until run-time issues are caused by it. Bug: swiftshader:153 Change-Id: I04ab6d8ae725ecab45ac27fd89a37213baa86943 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/47930 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent ec3650f5
......@@ -347,7 +347,7 @@
#define RETSIGTYPE void
/* Define if std::is_trivially_copyable is supported */
#define HAVE_STD_IS_TRIVIALLY_COPYABLE 1
/* #undef HAVE_STD_IS_TRIVIALLY_COPYABLE */
/* Define to a function implementing stricmp */
#define stricmp _stricmp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment