Questions tagged [clang-cl]

clang-cl is an alternative command line interface to Clang, which is part of the LLVM project. It is designed for compatibility with Microsoft's cl.exe. Use this tag for problems encountered that are specific to using clang-cl.

clang-cl is an alternative command line interface to Clang. Part of the LLVM project, it is designed for compatibility with Microsoft's Visual C++ compiler, cl.exe.

See the documentation for details on setting up and configuring your system to use it.

46 questions
2
votes
0 answers

Clang-CL compiler error : cannot mangle this 'auto' type yet

Clang-CL compiler error : cannot mangle this 'auto' type yet Context : Clang-CL compilation attempts currently results in the following error in several of my codebases : cannot mangle this 'auto' type yet Because this error message does not come…
Guss
  • 762
  • 4
  • 20
2
votes
0 answers

VS Code with Clang-Cl under Windows: Build Error

I want to use Clang-Cl under Windows to build my projects. As generator I use Ninja and my IDE is Visual Studio Code to which I switched recently. VS Code uses the compiler kit { "name": "Clang 9.0.0 für MSVC mit Visual Studio Build Tools 2019…
2
votes
1 answer

Are there compatibility issues with clang-cl and arch:avx2?

I'm using Windows 10, Visual Studio 2019, Platform: x64 and have the following test script in a single-file Visual Studio Solution: #include #include using namespace std; int main() { unsigned __int64 mask =…
polortiz40
  • 391
  • 4
  • 13
2
votes
1 answer

clang-cl PCH missing header include error

We generate our PCH as a preprocess step before compile time and then force include the PCH into every file in the project. This works fine for us with MSVC cl but clang-cl is checking to see if the PCH is included in the sources (excluded by…
Dan Cobban
  • 21
  • 1
2
votes
2 answers

Enable C++ Modules TS in clang-cl

I am using clang (from LLVM version 7.00) on Windows via clang-cl. I am trying to get C++ Modules to work. I have tried the clang command line arguments -fmodules-ts and -fmodules. I have also tried the msvc command line arguments (which work under…
keith
  • 5,122
  • 3
  • 21
  • 50
2
votes
2 answers

cmake detects clang-cl as clang

I built boringssl with cmake and msvc Then I tried to build with clang-cl so I used -T"LLVM-vs2014" in vmake arguments Clang-cl uses cl arguments however cmake used gcc style arguments without adding -Xclang
dev65
  • 1,440
  • 10
  • 25
2
votes
1 answer

Compiler attribute stuck on a function type - is there a workaround for this clang-cl bug?

When using the C++ LLVM-vs2014 configuration in Visual Studio 2015, this static assert fails. The assert does not fail in clang++, gcc, or even Visual C++. The thiscall attribute is stuck on the function type, even though it's no longer applicable.…
2
votes
1 answer

Using clang-cl 64 bit on windows 8.1

I'v just started using clang-cl on windows, because I need to use inline assembly in 64 bit app, and Visual Studio 2015 doesn't support that, so I was told to go for clang-cl. I downloaded a pre-built binary (clang 3.7.0) from here, the windows 64…
user2554080
  • 300
  • 3
  • 13
1
vote
0 answers

How to build visual studio project with clang-cl.exe and link libstdc++?

I want to compile my vs project with clang-cl.exe in visual studio and use standard c++ library like libc++ or libstdc++. it seems libc++ not supprot windows platform, so is there a right way to compile with clang-cl.exe and link standard c++…
MasterGhui
  • 11
  • 1
1
vote
0 answers

QT MSVC environment undefined Symbols and dllimport errors with self built libs

When building several 3rd party libraries from source I get undefined symbols build errors or dll import errors. Im trying to work out why certain functions don't link/can't be linked. I am using qt creator 7.0.0 qt.6.2.4 online installer linked to…
1
vote
1 answer

Distinguish between Clang CL and MSVC CL

There is CLang-CL which is a drop-in replacement for MSVC's CL. Does anyone know how to distinguish if my code is currently compiled by clang-cl or msvc's cl? Without passing any extra defined macros on command line. Using #ifdef…
Arty
  • 14,883
  • 6
  • 36
  • 69
1
vote
0 answers

clang-cl doesn't allow operator-overloads for __m128 because it's not a class or enum? Workaround to make it like MSVC?

The following code builds just fine under cl, but fails under clang-cl: #define NUDGE_FORCEINLINE __forceinline NUDGE_FORCEINLINE __m128 operator-(__m128 a) { return _mm_xor_ps(a, _mm_set1_ps(-0.0f)); } This is the error…
ompadu
  • 71
  • 1
  • 5
1
vote
1 answer

clang-cl and CMAKE

I tried to build simple program with CMAKE using clang on Windows, but CMAKE gave me error. CMake Error at C:/Program Files/CMake/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:859 (message): The Clang compiler tool "C:/Program…
NoSenseEtAl
  • 28,205
  • 28
  • 128
  • 277
0
votes
0 answers

clang-cl vs new msvc preprocessor

I wrote C11 code with heavy macro magic. MSVC has new preprocessor mode, enabled with /Zc:preprocessor . This mode is perfectly compatible with GCC and Clang preprocessor, so it does macro magic well. But I want to use expression block language…
funny_falcon
  • 427
  • 3
  • 11
0
votes
1 answer

Clang-CL build using Cmake + ninja gives error while compiling WinSDK standard headers

I have software that uses WinSDK using MSVC compiler. I'm trying to build it using ClangCL and ninja. I have alreadu succeded in build of ClangCL without ninja cmake {some stuff} -T ClangCL But this kind of build is too slow, I'm trying to engage…
RedApe
  • 119
  • 1
  • 6