[cfe-dev] invalid-token-paste

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


On Wed, Jul 18, 2012 at 7:13 PM, James Dennett <james.dennett at gmail.com>wrote:

> 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.
>
> In the middle of the error message I see
>
> 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))
>
> and line 36 of boost/preprocessor/tuple/elem.hpp is inside a
> #    if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
> block that presumably works around some MSVC problem, but in doing so
> relies on non-portable token pasting in this case.
>
> I don't know enough of the magic that is BOOST_PP_CONFIG_FLAGS to know
> why it's following that path -- maybe your clang is configured in such
> a way that Boost thinks that it's MSVC++ -- but Clang doesn't have
> complete emulation of MSVC++ quirks, so if that's the case I'm not
> shocked that this isn't working.


As it happens, we do support this quirk, but it's so quirky that it's an
error by default even in Microsoft mode. One could use
-Wno-invalid-token-paste to disable the diagnostic (with MS-style behavior
for the result), but I have no idea whether there are other things MSVC
mode might enable which we actually don't support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120718/139affcf/attachment.html>


More information about the cfe-dev mailing list