Boost C++ Libraries: Ticket #12995: Clang/C2 support https://svn.boost.org/trac10/ticket/12995 <p> It would be nice to get Boost to compile under Clang/C2 in Visual C++ 2017. Boost 1.63 almost did that, but Boost 1.64 does not. The problem is that Boost recognizes the compiler as Visual Studio, and then applies the corresponding workarounds. In particular, the workarounds include incorrect "pasting" in the implementation of macros in VC++, but that workaround is then an error under Clang. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12995 Trac 1.4.3 steinar+boost@… Thu, 06 Jul 2017 09:19:09 GMT component changed; owner set https://svn.boost.org/trac10/ticket/12995#comment:1 https://svn.boost.org/trac10/ticket/12995#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">preprocessor</span> </li> </ul> <p> From what I can see, this is primarily a bug in Boost.PP. Example code that only #includes &lt;boost/mpl/vector.hpp&gt; and nothing more, under Clang 3.9.1 on Windows: </p> <pre class="wiki">&gt; clang-cl -I r:/ade/boost_1_64_0 test.cc In file included from test.cc:1: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost/boost_1_64_0\boost/mpl/void.hpp(71,1): error: pasting formed 'BOOST_PP_TUPLE_ELEM_O_3(', an invalid preprocessing token [-Winvalid-token-paste] BOOST_MPL_AUX_NA_SPEC(1, is_void_) ^ r:/ade/boost/boost_1_64_0\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) \ ^ r:/ade/boost/boost_1_64_0\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) \ ^ r:/ade/boost/boost_1_64_0\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 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) r:/ade/boost/boost_1_64_0\boost/mpl/aux_/preprocessor/def_params_tail.hpp(82,11): note: expanded from macro 'BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL' BOOST_PP_SUB_D(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, i) \ ^ r:/ade/boost/boost_1_64_0\boost/preprocessor/arithmetic/sub.hpp(46,37): note: expanded from macro 'BOOST_PP_SUB_D' # define BOOST_PP_SUB_D(d, x, y) BOOST_PP_SUB_D_I(d, x, y) ^ r:/ade/boost/boost_1_64_0\boost/preprocessor/arithmetic/sub.hpp(47,86): note: expanded from macro 'BOOST_PP_SUB_D_I' # define BOOST_PP_SUB_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_SUB_P, BOOST_PP_SU... ^ In file included from test.cc:1: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost/boost_1_64_0\boost/mpl/void.hpp(71,23): error: too many arguments provided to function-like macro invocation BOOST_MPL_AUX_NA_SPEC(1, is_void_) ^ r:/ade/boost/boost_1_64_0\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 test.cc:1: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost/boost_1_64_0\boost/mpl/void.hpp(71,1): error: pasting formed 'BOOST_PP_TUPLE_ELEM_O_3(', an invalid preprocessing token [-Winvalid-token-paste] BOOST_MPL_AUX_NA_SPEC(1, is_void_) [more errors…] </pre><p> You can work around these immediate issues with -Wno-invalid-token-paste (it's a warning that by default is an error). However, it doesn't fix everything: </p> <pre class="wiki">&gt; clang-cl -Wno-invalid-token-paste -I r:/ade/boost_1_64_0 test.cc In file included from test.cc:1: In file included from r:/ade/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost_1_64_0\boost/mpl/void.hpp(71,23): error: too many arguments provided to function-like macro invocation BOOST_MPL_AUX_NA_SPEC(1, is_void_) ^ r:/ade/boost_1_64_0\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 test.cc:1: In file included from r:/ade/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost_1_64_0\boost/mpl/void.hpp(71,1): error: expected a qualified name after 'typename' BOOST_MPL_AUX_NA_SPEC(1, is_void_) ^ r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\boost/mpl/aux_/preprocessor/params.hpp(58,11): note: expanded from macro 'BOOST_MPL_PP_PARAMS' , BOOST_MPL_PP_AUX_PARAM_FUNC \ ^ In file included from test.cc:1: In file included from r:/ade/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost_1_64_0\boost/mpl/void.hpp(71,1): error: expected ',' or '&gt;' in template-parameter-list r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\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) \ ^ #define BOOST_MPL_AUX_NA_SPEC(i, name) \ ^ r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\boost/mpl/aux_/preprocessor/params.hpp(58,11): note: expanded from macro 'BOOST_MPL_PP_PARAMS' , BOOST_MPL_PP_AUX_PARAM_FUNC \ ^ In file included from test.cc:1: In file included from r:/ade/boost_1_64_0\boost/mpl/vector.hpp:36: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector20.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector10.hpp:18: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/vector0.hpp:17: In file included from r:/ade/boost_1_64_0\boost/mpl/vector/aux_/at.hpp:20: r:/ade/boost_1_64_0\boost/mpl/void.hpp(71,1): error: expected ',' or '&gt;' in template-parameter-list r:/ade/boost_1_64_0\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) \ ^ r:/ade/boost_1_64_0\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) \ ^ </pre> Ticket steinar+boost@… Thu, 06 Jul 2017 10:04:35 GMT <link>https://svn.boost.org/trac10/ticket/12995#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12995#comment:2</guid> <description> <p> Unsetting BOOST_PP_VARIADICS_MSVC for Clang helps a great deal. </p> </description> <category>Ticket</category> </item> </channel> </rss>