[llvm-bugs] [Bug 42112] New: Preprocessor macro expansion bug on Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 3 04:18:35 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42112

            Bug ID: 42112
           Summary: Preprocessor macro expansion bug on Windows
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: woodstock at gmx.us
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

The following code

#define BOOST_PP_CAT_II(p, res) res
#define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
#define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
#define BOOST_PP_VARIADIC_ELEM_0(e0, ...) e0
#define BOOST_PP_VARIADIC_ELEM_I(n, ...)
BOOST_PP_CAT(BOOST_PP_CAT(BOOST_PP_VARIADIC_ELEM_, n)(__VA_ARGS__,),)
#define BOOST_PP_VARIADIC_ELEM(n, ...) BOOST_PP_VARIADIC_ELEM_I(n,__VA_ARGS__)
BOOST_PP_VARIADIC_ELEM(0,,)

should expand to nothing, which works fine on Linux with clang and gcc and on
Windows with VC++, but on Windows with clang it expands to

,

This can be reproduced simply with "clang.exe -E code.cpp", so it is
independent of Visual Studio, etc.

Obviously the code comes from the Boost Preprocessor library, but it affects
more the Boost VMD library, e.g. the macro BOOST_VMD_IS_TUPLE() works
incorrectly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190603/1b4185bc/attachment.html>


More information about the llvm-bugs mailing list