[llvm-bugs] [Bug 51609] New: Error when passing 0 args to a variadic macro parameters with `-std=c++20 -pedantic-errors`

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 24 14:57:49 PDT 2021


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

            Bug ID: 51609
           Summary: Error when passing 0 args to a variadic macro
                    parameters with `-std=c++20 -pedantic-errors`
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: blckcat at inbox.ru
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Starting from C++20, it's allowed to pass 0 arguments to the variadic macro
parameter.

I.e. following should be allowed:
    #define FOO(x, ...)
    FOO(42)

Clang successfully compiles it by default, but if you add `-std=c++20
-pedantic-errors`, it starts (incorrectly) complaining:

    error: must specify at least one argument for '...' parameter of variadic
macro [-Werror,-Wgnu-zero-variadic-macro-arguments]

`-pedantic-errors` should only enable this diagnostic in C++17 and earlier.

-- 
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/20210824/88bf28df/attachment.html>


More information about the llvm-bugs mailing list