[llvm-bugs] [Bug 35617] New: Preprocessor bug (variadic macros)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 11 01:09:21 PST 2017


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

            Bug ID: 35617
           Summary: Preprocessor bug (variadic macros)
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jkl9543 at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

#define xcombine(A,B,...)  A ## B ## __VA_ARGS__
#define m(x,...)           xcombine(x,__VA_ARGS__)
m(1) //CLANG should NOT bark "too few arguments".
m(1,2) //GCC/MSC/CLANG works fine.

#define ycombine(A,B)      A ## B
#define n(x,...)           ycombine(x,##__VA_ARGS__)
n(1) //MSC/CLANG fail to detect error: macro "ycombine" requires 2 arguments,
but only 1 given.
n(1,2) //no problem.

-- 
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/20171211/0710f0d0/attachment.html>


More information about the llvm-bugs mailing list