[PATCH] D86126: Fix issue 47160: "`llvm::is_trivially_copyable` -- static assertion failure after DR 1734"

Jason Vas Dias via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 12:22:56 PST 2021


JVD added a comment.

I also was seeing this problem, when trying to build LLVM with Visual Studio 2019 Community Edition version 16.8.4, 
on Windows 10 Pro x86_64 build 19042.746 update 20H2 , fully up-to-date as of 2021/01/15 .

In my case, the problem was fixed by this patch:

$ diff -wB0U3 llvm-10.0.1.src/include/llvm/ADT/SmallVector.h,10.0.0.1.src  llvm-10.0.1.src/include/llvm/ADT/SmallVector.h

- llvm-10.0.1.src/include/llvm/ADT/SmallVector.h,10.0.0.1.src 2021-01-15 20:10:44.407349600 +0000

+++ llvm-10.0.1.src/include/llvm/ADT/SmallVector.h      2021-01-15 18:38:01.985069700 +0000
@@ -229,8 +229,8 @@
 };

// Define this out-of-line to dissuade the C++ compiler from inlining it.
-template <typename T, bool TriviallyCopyable>
-void SmallVectorTemplateBase<T, TriviallyCopyable>::grow(size_t MinSize) {
+template <typename T, bool TRV = is_trivially_copyable<T>::value>
+void SmallVectorTemplateBase<T,TRV>::grow(size_t MinSize) {

  if (MinSize > UINT32_MAX)
    report_bad_alloc_error("SmallVector capacity overflow during allocation");


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86126/new/

https://reviews.llvm.org/D86126



More information about the llvm-commits mailing list