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: unassignedclangb...@nondot.org
          Reporter: blck...@inbox.ru
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to