Boost logo

Boost :

Subject: Re: [boost] [smart_ptr][thread] Build failures
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2017-03-01 09:33:47


On 03/01/17 12:02, Raffi Enficiaud via Boost wrote:
> Hi all,
>
> I have the following compilation issues on master and develop, failing
> the VS2008, VS2012, VS2013 builds for boost.test (VS2015 ok):
>
>
> 01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread
> 01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread\build
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi\win32
>
> 01-Mar-2017 09:57:45 compile-c-c++
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi\win32\thread.obj
>
> 01-Mar-2017 09:57:45 thread.cpp
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/thread/detail/thread.hpp(486)
> : warning C4067: unexpected tokens following preprocessor directive -
> expected a newline

Looks like the compiler doesn't recognize alternative spelling of
boolean operators (`and` in this case), which should be keywords. The
workaround is simple: replace it with the primary spelling `&&`.

> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(355)
> : error C2059: syntax error : ')'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(358)
> : see reference to class template instantiation
> 'boost::detail::sp_less_align<T,U>' being compiled
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2143: syntax error : missing ')' before ';'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2143: syntax error : missing '}' before ')'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2059: syntax error : ')'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2238: unexpected token(s) preceding ';'

This code looks correct to me. I can only guess what the compiler is
complaining about. Maybe it thinks the operator `<` is an opening angle
brace for template parameters. Can you try wrapping
`boost::alignment_of<T>::value` and `boost::alignment_of<U>::value` in
parenthesis?

In any case, I think both these issues should be reported to MS Connect.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk