Boost logo

Boost :

Subject: [boost] Clang 4.0.0 MPL error in Boost next.hpp and prior.hpp
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2017-03-24 18:13:32


I am trying to check code that works on VS2015 update 3 and GCC 6.3.0 using Clang 4.0.0

I am using the CodeBlocks IDE (though I don't think that is relevant).

The code indirectly uses next.hpp and prior.hpp

There are several warnings like this (after adding the -Wignored-attributes option)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h|45|warning: __declspec attribute 'intrin_type' is not
supported [-Wignored-attributes]

I:\modular-boost\boost\mpl\next_prior.hpp|44|error: too many arguments provided to function-like macro invocation|

Following suggestions in this thread, I have added -Wno-invalid-token-paste
http://clang-developers.42468.n3.nabble.com/invalid-token-paste-td4025526.html

and also -DBOOST_PP_CONFIG_FLAGS=1,

but I get a blizzard of errors - see below

It would seem that this may be because of a misconfiguration in Boost mpl?

If I understand right, the thread above suggests that this is MS pre-processor-specific MPL code because of code in
boost/preprocessor/config/config.hpp that determines the MPL code?

Is this correct?
Target: x86_64-pc-windows-msvc
-triple x86_64-pc-windows-msvc19.0.24123

Complete log attached in case this helps.

Can anyone say what I am doing wrong and/or suggest a workaround for this?

Thanks

Paul

Compile line is

clang++.exe -Wall -fexceptions -Wignored_attributes -D"BOOST_PP_CONFIG_FLAGS()"=1 -m64 -v -Wignored-attributes
-Wno-invalid-token-paste -II:\modular-boost -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -c
J:\Cpp\Misc\lambert_w_single\lambert_w_single.cpp -o .objs\Misc\lambert_w_single\lambert_w_single.o
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\bin
 "C:\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.0.24123

In file included from I:\modular-boost\boost/mpl/next.hpp:17:
I:\modular-boost\boost/mpl/next_prior.hpp:44:23: error: too many arguments provided to function-like macro invocation
BOOST_MPL_AUX_NA_SPEC(1, next)
                      ^
I:\modular-boost\boost/preprocessor/facilities/expand.hpp:26:10: note: macro 'BOOST_PP_EXPAND_I' defined here
# define BOOST_PP_EXPAND_I(x) x
         ^

In file included from I:\modular-boost\boost/mpl/next.hpp:17:
I:\modular-boost\boost/mpl/next_prior.hpp:44:1: error: expected a qualified name after 'typename'
BOOST_MPL_AUX_NA_SPEC(1, next)
^
I:\modular-boost\boost/mpl/aux_/na_spec.hpp:161:40: note: expanded from macro 'BOOST_MPL_AUX_NA_SPEC'
#define BOOST_MPL_AUX_NA_SPEC(i, name) \
                                       ^
I:\modular-boost\boost/mpl/aux_/na_spec.hpp:154:47: note: expanded from macro '\
BOOST_MPL_AUX_NA_SPEC_NO_ETI'
#define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
                                              ^
I:\modular-boost\boost/mpl/aux_/na_spec.hpp:64:11: note: expanded from macro '\
BOOST_MPL_AUX_NA_SPEC_MAIN'
          BOOST_MPL_PP_PARAMS(i, typename T) \
          ^
I:\modular-boost\boost/mpl/aux_/preprocessor/params.hpp:58:11: note: expanded from macro 'BOOST_MPL_PP_PARAMS'
        , BOOST_MPL_PP_AUX_PARAM_FUNC \
          ^

...

I:\modular-boost\boost/mpl/void.hpp:71:1: error: expected ',' or '>' in template-parameter-list
I:\modular-boost\boost/mpl/aux_/na_spec.hpp:161:40: note: expanded from macro 'BOOST_MPL_AUX_NA_SPEC'
#define BOOST_MPL_AUX_NA_SPEC(i, name) \
                                       ^
I:\modular-boost\boost/mpl/aux_/na_spec.hpp:154:47: note: expanded from macro '\
BOOST_MPL_AUX_NA_SPEC_NO_ETI'
#define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
                                              ^
I:\modular-boost\boost/mpl/aux_/na_spec.hpp:65:9: note: expanded from macro '\
BOOST_MPL_AUX_NA_SPEC_MAIN'
        BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
        ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
I:\modular-boost\boost/preprocessor/repetition/repeat.hpp:38:37: note: expanded from macro 'BOOST_PP_REPEAT_1'
# define BOOST_PP_REPEAT_1(c, m, d) BOOST_PP_REPEAT_1_I(c, m, d)
                                    ^
I:\modular-boost\boost/preprocessor/repetition/repeat.hpp:43:39: note: expanded from macro 'BOOST_PP_REPEAT_1_I'
# define BOOST_PP_REPEAT_1_I(c, m, d) BOOST_PP_REPEAT_1_ ## c(m, d)
                                      ^
<scratch space>:64:1: note: expanded from here
BOOST_PP_REPEAT_1_BOOST_PP_REM
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830



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