[cfe-dev] LLVM 10.0.1 VS 2019 16.7 Error C2338 with is_trivially_copyable

Oliver Niebuhr via cfe-dev cfe-dev at lists.llvm.org
Sat Aug 15 10:35:43 PDT 2020


Am 10/08/2020 um 06:41 schrieb Oliver Niebuhr:
> Hello.
> 
> With Visual Studio 2019 16.7 I am getting the following Error:
> 
> [1437/4970]
> C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\cl.exe
>   /TP -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
> -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> -Ilib\ExecutionEngine\RuntimeDyld
> -IC:\Dev\GitRepos\llvm-project\llvm\lib\ExecutionEngine\RuntimeDyld
> -Iinclude -IC:\Dev\GitRepos\llvm-project\llvm\include /DWIN32 /D_WINDOWS
>   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146
> -wd4244 -wd4267 -wd4291 -wd4345 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459
> -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510
> -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805
> -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238
> /Gw /MD /O2 /Ob2 /DNDEBUG  /EHsc /GR -std:c++14 /showIncludes
> /Folib\ExecutionEngine\RuntimeDyld\CMakeFiles\LLVMRuntimeDyld.dir\RTDyldMemoryManager.cpp.obj
> /Fdlib\ExecutionEngine\RuntimeDyld\CMakeFiles\LLVMRuntimeDyld.dir\LLVMRuntimeDyld.pdb
> /FS -c
> C:\Dev\GitRepos\llvm-project\llvm\lib\ExecutionEngine\RuntimeDyld\RTDyldMemoryManager.cpp
> 
> FAILED:
> lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RTDyldMemoryManager.cpp.obj
> 
> 
> C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\cl.exe
>   /TP -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
> -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> -Ilib\ExecutionEngine\RuntimeDyld
> -IC:\Dev\GitRepos\llvm-project\llvm\lib\ExecutionEngine\RuntimeDyld
> -Iinclude -IC:\Dev\GitRepos\llvm-project\llvm\include /DWIN32 /D_WINDOWS
>   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146
> -wd4244 -wd4267 -wd4291 -wd4345 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459
> -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510
> -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805
> -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238
> /Gw /MD /O2 /Ob2 /DNDEBUG  /EHsc /GR -std:c++14 /showIncludes
> /Folib\ExecutionEngine\RuntimeDyld\CMakeFiles\LLVMRuntimeDyld.dir\RTDyldMemoryManager.cpp.obj
> /Fdlib\ExecutionEngine\RuntimeDyld\CMakeFiles\LLVMRuntimeDyld.dir\LLVMRuntimeDyld.pdb
> /FS -c
> C:\Dev\GitRepos\llvm-project\llvm\lib\ExecutionEngine\RuntimeDyld\RTDyldMemoryManager.cpp
> 
> Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29110 for x64
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/Support/type_traits.h(181):
> error C2338: inconsistent behavior between llvm:: and std::
> implementation of is_trivially_copyable
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/ADT/SmallVector.h(315):
> note: see reference to class template instantiation
> 'llvm::is_trivially_copyable<T>' being compiled
>         with
>         [
>             T=std::pair<void *,size_t>
>         ]
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/ADT/SmallVector.h(837):
> note: see reference to class template instantiation
> 'llvm::SmallVectorImpl<T>' being compiled
>         with
>         [
>             T=std::pair<void *,size_t>
>         ]
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/Support/Allocator.h(378):
> note: see reference to class template instantiation
> 'llvm::SmallVector<std::pair<void *,size_t>,0>' being compiled
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/Support/Allocator.h(435):
> note: see reference to class template instantiation
> 'llvm::BumpPtrAllocatorImpl<AllocatorT,SlabSize,SizeThreshold>' being
> compiled
> 
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/ADT/SmallVector.h(315):
> error C2976: 'llvm::SmallVectorTemplateBase': too few template arguments
> C:\Dev\GitRepos\llvm-project\llvm\include\llvm/ADT/SmallVector.h(179):
> note: see declaration of 'llvm::SmallVectorTemplateBase'
> --- END ---
> 
> CMake: 3.18.0
> Ninja: 1.10
> LLVM: 10.0.1 Git Branch
> 
> Works with: VS 2019 16.6.5, 16.6.6
> 
> Additional Compiler Flags tested: /std:c++17 (which gets overwritten
> with /std:c++14 no matter what), /permissive and /permissive-
> 
> I looked through the Interweb but did only found 2 old LLVM Bug Reports
> for LLVM 7.x which are closed.
> 
> Everything points to being an "underwhelming" work around in LLVM.
> Therefore: Is this a Problem with LLVM or do I need to Report this to
> the VS Team?
> Thanks!
> Oliver
> 
As no one answered my Question, I have to answer it my self: I switched
to the 11.x Branch and now it works again. So either LLVM was broken or
VS. Or both.

Stay safe everyone
Oliver

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200815/bb2bd3a4/attachment-0001.sig>


More information about the cfe-dev mailing list