[cfe-dev] invalid-token-paste

Richard Smith richard at metafoo.co.uk
Wed Jul 18 19:13:09 PDT 2012


On Wed, Jul 18, 2012 at 6:35 PM, Shang Yu <yusunn at gmail.com> wrote:

> Hi James, this code is just a simplified example. In fact I
> encountered the problem when I'm testing clang against boost. Please
> see the attachment.
>

E:\SRC\LIBS\boost_1_49_0\boost/mpl/next_prior.hpp:44:1: error: pasting
formed
      'BOOST_PP_TUPLE_ELEM_E_3(', an invalid preprocessing token
      [-Winvalid-token-paste]
BOOST_MPL_AUX_NA_SPEC(1, next)
^
E:\SRC\LIBS\boost_1_49_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) \
                                       ^
E:\SRC\LIBS\boost_1_49_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) \
                                              ^

Well, there's a bug in this diagnostic: we're including the \<newline> in
the name of the macro. Not related to the issue at hand, of course...

The real problem here is a boost bug. boost/preprocessor/config/config.hpp
is determining that the compiler is MSVC, and consequently feeding us this
non-conforming code:

E:\SRC\LIBS\boost_1_49_0\boost/preprocessor/tuple/elem.hpp:36:114: note:
      expanded from macro 'BOOST_PP_TUPLE_ELEM'
  ...n), BOOST_PP_CAT(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM_E_, size), tuple))
         ^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120718/4ce942b8/attachment.html>


More information about the cfe-dev mailing list