Boost logo

Boost :

Subject: Re: [boost] Using Boost with VS 14.0 update 3 RC and Clang 3.8.0 (from CodeBlocks IDE) compile fails in MS type_traits is_assignable
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-06-15 09:01:05

On 6/15/2016 5:47 AM, Paul A. Bristow wrote:
> I am trying to check a program that compiles on VS with 14.0 update 3 RC and on Codeblocks IDE GCC 5.3 compile OK, but CodeBlocks
> Clang 3.8.0 fails:
> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:524:45: error: '_To' does not refer to a value
> : integral_constant<bool, __is_assignable(_To, _From)>
> I:\modular-boost\boost\mpl\aux_\preprocessed\plain\or.hpp|58|error: pasting formed 'BOOST_PP_TUPLE_ELEM_O_3(', an invalid
> preprocessing token [-Winvalid-token-paste]
> and terminally many more.
> clang++.exe -Wall -std=c++14 -m64 -fexceptions -O4 -m64 -std=c++14 -fms-extensions -Wall -m64 -fms-compatibility-version=19.00
> -II:\modular-boost -c J:\Cpp\hellos\fixed_point_constexpr\fixed_point_constexpr.cpp -o obj\Release\fixed_point_constexpr.o
> I see some discussion of similar problem on
> and a possible apparent fix on
> Any suggestions for working around this problem?

I would like to point out once again that if clang is being used as the
compiler in VC++14, and its emulation of the non-standard VC++
preprocessor is being used, that emulation is broken as far as Boost PP
is concerned.

On the Boost PP 'develop' branch the emulation is triggered when both
__clang__ and _MSC_VER is predefined. In that case clang is treated as
VC++ as far as Boost PP is concerned.

I did not merge that change to the Boost PP 'master' branch prior to the
Boost 1.61 release, and have still not merged it although I could do so now.

On the Boost PP 'master' branch clang is treated as its normal C++
standard preprocessor. However if it is emulating the non-standard VC++
preprocessor then that won't work in Boost PP either.

Essentially clang's emulation of the VC++ preprocessor is broken as far
as Boost PP is concerned, whether clang is treated as VC++ or a C++
standard conforming preprocessor, in Boost PP code.

I have reported this to clang but I have received no indication that
they have fixed the problems I reported to them, and it is useless to
attempt to find and report further clang emulation of the VC++
preprocessor problems until the problems I have reported to them have
been fixed. As I mentioned in a previous message about this issue a
number of months back I suspect that clang will not fix these problems
so that Boost PP can work with its VC++ emulation, as it was a fool's
errand in the first place that led them down this path for all
preprocessor code.

Whether or not this is causing the problems you are encountering I do
not know but I suspect that it may be doing so.

> Paul
> PS I may try to use a *nix platform for this.

Boost list run by bdawes at, gregod at, cpdaniel at, john at