Using clang on Windows

Greetings List,

I would like to use clang on Windows, mostly for all these tools available with clang like modernize or tidy. However, I’m stuck at very basic stage of building thirdparties, namely boost. I cannot build it using b2, OTOH boost does not have clang in compatible compilers list for windows, so, I guess it is dead end. On the other hand most of boost usage is via NuGet packages which includes all necessary headers/sources right into VS project. I have clang 3.8 installed and if I try to build it using LLVM toolset from within VS2015 it fails with compilation errors, again, boost related.

So, the questions are is it possible at all to use clang on windows to build a decent sized project? Does anyone have successful experience building boost on windows? Does anyone have experience building large project using clang directly from VS?


Regarding clang on Windows - I use it personally to build a large project (JUCE), the only place it’s tripping up for me is exceptions.
Last time I tried working with VS 2015 and clang, clang couldn’t handle the headers. The situation on VS 2013 is much nicer.
Note that’s just building; I haven’t tried running it.

That’s what I’m trying to achieve, just compile it

  1. Exceptions are handled –

  2. I had problems with headers when tried to build boost using b2, no such a problem in VS but I get compilation errors

1>D:\Development\DEV4\Infrastructure\Server\Solutions\packages\boost.\build\native....\lib\native\include\boost/typeof/msvc/typeof_impl.hpp(150,31): error : template specialization or definition requires a template parameter list corresponding to the nested type ‘base_type’ (aka ‘msvc_extract_type’)

1> struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature

1> ~~~~~~~~~ ^

1>D:\Development\DEV4\Infrastructure\Server\Solutions\packages\boost.\build\native....\lib\native\include\boost/typeof/msvc/typeof_impl.hpp(150,20): error : nested name specifier for a declaration cannot depend on a template parameter

1> struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature

1> ^~~~~~~~~~~

Which is odd since this code is under #ifdef and should not be compiled at all.