Boost logo

Boost :

Subject: Re: [boost] Clang 4.0.0 MPL error in Boost next.hpp and prior.hpp
From: Peter Dimov (lists_at_[hidden])
Date: 2017-03-25 17:46:23


Edward Diener wrote:

> There is also BOOST_PP_VARIADICS_MSVC, which provides lots of special VC++
> variadics workarounds.

Yes there was, thanks for the hint.

#define BOOST_PP_CONFIG_FLAGS() 1
#include <boost/preprocessor/config/config.hpp>

#define BOOST_PP_VARIADICS_MSVC 0

#include <boost/mpl/list.hpp>
#include <boost/mpl/push_front.hpp>

int main()
{
    namespace mpl = boost::mpl;

    using L = mpl::list<>;
    using L2 = mpl::push_front<L, void>;
}

works.

The reason is

# elif defined _MSC_VER && _MSC_VER >= 1400 && (defined(__clang__) ||
!defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER)
&& __INTEL_COMPILER >= 1700)
# define BOOST_PP_VARIADICS 1
# undef BOOST_PP_VARIADICS_MSVC
# define BOOST_PP_VARIADICS_MSVC 1

which defines BOOST_PP_VARIADICS_MSVC for Clang and must not.

You can tell Clang to not define _MSC_VER (-fmsc-version="0"), but MS's
headers don't work with that yet (although STL said they are going to.)

-fno-ms-compatibility is default for Clang/C2 at least, so I think that the
above should just define BOOST_PP_VARIADICS_MSVC to 0 on Clang.


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