[cfe-dev] Compiling Boost.TypeTraits tests using VC++ RTL
Hans Wennborg
hans at chromium.org
Tue Nov 5 13:20:59 PST 2013
On Tue, Nov 5, 2013 at 10:05 AM, Edward Diener
<eldlistmailingz at tropicsoft.com> wrote:
> On 11/5/2013 11:48 AM, Hans Wennborg wrote:
>>
>> 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.
>
>
> Even with /fallback specified I am still seeing:
>
> error(clang): cannot mangle RTTI descriptors for type 'codecvt' yet
> error(clang): cannot mangle the name of type 'codecvt' into RTTI descriptors
> yet
> error(clang): cannot mangle RTTI descriptors for type 'codecvt_base' yet
> error(clang): cannot mangle the name of type 'codecvt_base' into RTTI
> descriptors yet
> error(clang): cannot mangle RTTI descriptors for type 'facet' yet
> error(clang): cannot mangle the name of type 'facet' into RTTI descriptors
> yet
> error(clang): cannot mangle RTTI descriptors for type '_Facet_base' yet
> error(clang): cannot mangle the name of type '_Facet_base' into RTTI
> descriptors yet
Yes, in /fallback mode, clang-cl will still print the errors it
encounters, but it will then try building with cl.exe afterwards.
> BTW I see a great deal of:
>
> note(clang): expanded from macro 'XXX'
>
> in the output when macros are bring expanded. While this may be ordinarily
> helpful for macro expansion I would like to turn this off by default. How do
> I do that ?
I don't think Clang has an option to turn these off (others on this
list please correct me if I'm wrong), but there is an option to limit
the length of the backtrace: -fmacro-backtrace-limit. This is not
currently exposed in clang-cl though :/
Thanks,
Hans
More information about the cfe-dev
mailing list