[cfe-dev] Compiling Boost.TypeTraits tests using VC++ RTL

Hans Wennborg hans at chromium.org
Tue Nov 5 08:48:27 PST 2013


Hi Edward,

On Fri, Nov 1, 2013 at 8:57 AM, Edward Diener
<eldlistmailingz at tropicsoft.com> wrote:
> If I compile Boost type traits on Windows using VC++ RTL I get:
>
> "add_const_test.cpp"
> -Fo"..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-vc10-win-3.4\debug\add_const_test.obj"
> -TP /Od /Ob0 /W4 /GR /MDd  /Zc:forScope /Zc:wchar_t -fmsc-version=1600
> /wd4675 /EHs -c
> -DBOOST_ALL_NO_LIB=1
> "-I..\..\.."
> compile-c-c++
> ..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-vc10-win-3.4\debug\add_const_test.obj
>
>     call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
> x86 > nul
>
> "C:\Programming\VersionControl\clang_build\bin\Release\clang-cl.exe"
> @"..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-vc10-win-3.4\debug\add_const_test.obj.rsp"
>
> clang-cl.exe: warning: argument unused during compilation: '/EHs'
> error: cannot mangle RTTI descriptors for type 'codecvt' yet
> error: cannot mangle the name of type 'codecvt' into RTTI descriptors yet
> error: cannot mangle RTTI descriptors for type 'codecvt_base' yet
> error: cannot mangle the name of type 'codecvt_base' into RTTI descriptors
> yet
> error: cannot mangle RTTI descriptors for type 'facet' yet
> error: cannot mangle the name of type 'facet' into RTTI descriptors yet
> 6 errors generated.""
>
> If I add '-D_HAS_EXCEPTIONS=0 /GR-' as recommended I then get, when
> including 'typeinfo':
>
> ""add_const_test.cpp"
> -Fo"..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-vc10-win-3.4\debug\add_const_test.obj"
> -TP /Od /Ob0 /W4 /GR /MDd  /Zc:forScope /Zc:wchar_t -fmsc-version=1600
> /wd4675 /EHs -D_HAS_EXCEPTIONS=0 /EH- /GR- -c
> -DBOOST_ALL_NO_LIB=1
> "-I..\..\.."
> compile-c-c++
> ..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-vc10-win-3.4\debug\add_const_test.obj
>
>     call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
> x86 > nul
>
> "C:\Programming\VersionControl\clang_build\bin\Release\clang-cl.exe"
> @"..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-vc10-win-3.4\debug\add_const_test.obj.rsp"
>
> clang-cl.exe: warning: argument unused during compilation: '/EHs'
> clang-cl.exe: warning: argument unused during compilation: '/EH-'
> In file included from add_const_test.cpp:7:
> In file included from ./test.hpp:10:
> In file included from ..\..\..\boost/config.hpp:44:
> In file included from ..\..\..\boost/config/stdlib/dinkumware.hpp:89:
> c:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\typeinfo(156,10) :
> error: unknown class name 'exception'; did you mean '_exception'?
>         : public exception"
>
> Is there a workaround to either of these problems ?

It seems the reality here is that clang-cl just cannot compile this
file today. The work-around for that situation is to compile with the
/fallback option [1]. I also just published a blog post about this
[2].

Hopefully that helps.

 - Hans

[1]. http://clang.llvm.org/docs/UsersManual.html#the-fallback-option
[2]. http://blog.llvm.org/2013/11/the-clang-cl-fallback-mode.html



More information about the cfe-dev mailing list