Clang Integration with MSVS 2013

I just installed the pre-compiled binaries for Clang 3.4.1, which was the latest version I could find to download. Starting a new ‘blank’ project in MSVC I was easily able to change the tool set from MS Visual Studio 2013 (v120) to LLVM-vs2013.

However, trying to compile a simple ‘hello world’ program resulted in the following compiler errors. Is there something simple I am missing?

Thanks,

-Matt

1>------ Build started: Project: Project2, Configuration: Release Win32 ------
1>clang-cl.exe : warning : argument unused during compilation: ‘/Zi’
1>clang-cl.exe : warning : argument unused during compilation: ‘/Gm-’
1>clang-cl.exe : warning : argument unused during compilation: ‘/EHsc’
1>clang-cl.exe : warning : argument unused during compilation: ‘/GS’
1>clang-cl.exe : warning : argument unused during compilation: ‘/Gy’
1>clang-cl.exe : warning : argument unused during compilation: ‘/fp:precise’
1>clang-cl.exe : warning : argument unused during compilation: ‘/Zc:wchar_t-’
1>clang-cl.exe : warning : argument unused during compilation: ‘/FdRelease\vc120.pdb’
1>clang-cl.exe : warning : argument unused during compilation: ‘/Gd’
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdexcept:7:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstring:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0:9:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\utility:8:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(620,32): error : ‘_Ty’ does not refer to a value
1> : _Cat_base<_IS_CONSTRUCTIBLE(_Ty, _Args…)>
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(617,15) : note: declared here
1> template<class _Ty,
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(621,1): error : expected class name
1> { // determine whether _Ty(_Args…) is constructible
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(746,19): error : ‘_Ty’ does not refer to a value
1> _IS_DESTRUCTIBLE(_Ty)
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(48,31) : note: expanded from macro ‘_IS_DESTRUCTIBLE’
1> : _Cat_base<__is_destructible(_Ty)>
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(744,15) : note: declared here
1> template
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(747,1): error : expected class name
1> { // determine whether _Ty has a destructor
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(887,40): error : ‘_Ty’ does not refer to a value
1> : _Cat_base<_IS_NOTHROW_CONSTRUCTIBLE(_Ty, _Args…)>
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(884,15) : note: declared here
1> template<class _Ty,
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(888,1): error : expected class name
1> { // determine whether _Ty(_Args…) is nothrow constructible
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(951,25): error : ‘_To’ does not refer to a value
1> _IS_NOTHROW_ASSIGNABLE(_To, _From)
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(50,37) : note: expanded from macro ‘_IS_NOTHROW_ASSIGNABLE’
1> : _Cat_base<__is_nothrow_assignable(_To, _From)>
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(947,15) : note: declared here
1> template<class _To,
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(953,1): error : expected class name
1> { // determine whether _From can be assigned to _To, nothrow
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(1000,27): error : ‘_Ty’ does not refer to a value
1> _IS_NOTHROW_DESTRUCTIBLE(_Ty)
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(52,39) : note: expanded from macro ‘_IS_NOTHROW_DESTRUCTIBLE’
1> : _Cat_base<__is_nothrow_destructible(_Ty)>
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(997,15) : note: declared here
1> template
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\type_traits(1002,1): error : expected class name
1> { // determine whether _Ty has a nothrow destructor
1> ^
1> 10 errors generated.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

This was http://llvm.org/bugs/show_bug.cgi?id=18906, which was fixed between 3.4 and 3.5. We have a 3.5 pre-release squirreled away here:
http://llvm.org/pre-releases/3.5/

That should turn into a real 3.5 release sometime in the next few weeks, for which Windows support should be pretty robust. The major remaining incompatibilities are usually SEH, SSE intriniscs, and inline assembly.

Thanks Reid,

I downloaded the 3.5 release candidate. Now, I’m getting completely different errors. Is there something simple I am missing so far as setting up a project in Visual Studio to be compatible with Clang? Here is the build log:

Thanks,

-Matt

1>------ Build started: Project: Project2, Configuration: Release Win32 ------
1>clang-cl.exe : warning : argument unused during compilation: ‘/Gm-’
1>clang-cl.exe : warning : argument unused during compilation: ‘/GS’
1>clang-cl.exe : warning : argument unused during compilation: ‘/fp:precise’
1>clang-cl.exe : warning : argument unused during compilation: ‘/Zc:wchar_t-’
1>clang-cl.exe : warning : argument unused during compilation: ‘/FdRelease\vc120.pdb’
1>clang-cl.exe : warning : argument unused during compilation: ‘/Gd’
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(800,3): error : cannot compile this try statement yet
1> _TRY_IO_BEGIN
1> ^~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(19,24) : note: expanded from macro ‘_TRY_IO_BEGIN’
1> #define _TRY_IO_BEGIN _TRY_BEGIN /* begin try block */
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase(287,4): error : cannot compile this throw expression yet
1> _RERAISE;
1> ^~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(36,19) : note: expanded from macro ‘_RERAISE’
1> #define _RERAISE throw
1> ^~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase(289,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(failure, “ios_base::badbit set”);
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase(291,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(failure, “ios_base::failbit set”);
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase(293,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(failure, “ios_base::eofbit set”);
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream(145,5): error : cannot compile this try statement yet
1> _TRY_IO_BEGIN
1> ^~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(19,24) : note: expanded from macro ‘_TRY_IO_BEGIN’
1> #define _TRY_IO_BEGIN _TRY_BEGIN /* begin try block /
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(582,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(_XSTD bad_cast, _EMPTY_ARGUMENT); // lazy disallowed
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale:10:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocinfo(78,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(runtime_error, “bad locale name”);
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream(301,4): error : cannot compile this try statement yet
1> _TRY_IO_BEGIN
1> ^~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(19,24) : note: expanded from macro ‘_TRY_IO_BEGIN’
1> #define _TRY_IO_BEGIN _TRY_BEGIN /
begin try block */
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(582,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(_XSTD bad_cast, _EMPTY_ARGUMENT); // lazy disallowed
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream(145,5): error : cannot compile this try statement yet
1> _TRY_IO_BEGIN
1> ^~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(19,24) : note: expanded from macro ‘_TRY_IO_BEGIN’
1> #define _TRY_IO_BEGIN _TRY_BEGIN /* begin try block */
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(582,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(_XSTD bad_cast, _EMPTY_ARGUMENT); // lazy disallowed
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(167,3): error : cannot compile this try statement yet
1> _TRY_BEGIN
1> ^~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream(167,3): error : cannot compile this try statement yet
1> _TRY_BEGIN
1> ^~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdexcept:7:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstring(2214,3): error : cannot compile this try statement yet
1> _TRY_BEGIN
1> ^~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(582,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(_XSTD bad_cast, _EMPTY_ARGUMENT); // lazy disallowed
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdexcept:7:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstring(2214,3): error : cannot compile this try statement yet
1> _TRY_BEGIN
1> ^~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum(170,3): error : cannot compile this try statement yet
1> _TRY_BEGIN
1> ^~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(30,21) : note: expanded from macro ‘_TRY_BEGIN’
1> #define _TRY_BEGIN try {
1> ^
1> In file included from Source.cpp:2:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xiosbase:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(582,4): error : cannot compile this throw expression yet
1> _THROW_NCEE(_XSTD bad_cast, _EMPTY_ARGUMENT); // lazy disallowed
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(56,30) : note: expanded from macro ‘_THROW_NCEE’
1> #define _THROW_NCEE(x, y) throw x(y)
1> ^~~~~~~~~~
1>CL : fatal error : too many errors emitted, stopping now [-ferror-limit=]
1> 20 errors generated.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hi Matthew,

Have you tried the following: as a quick fix, you should go to Project Properties and navigate to Configuration Properties, C/C++, Command Line, Additional Options and put /GR- /D_HAS_EXCEPTIONS=0 there.

In your case, Clang is trying to parse MSVC headers with exceptions support, but it currently lacks this feature. Setting _HAS_EXCEPTIONS to 0 is a hack to disable exceptions in those header files.