<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76375>76375</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang wrongly warns about empty variadic argument lists for macros
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hasselmm
</td>
</tr>
</table>
<pre>
Clang warns about empty variadic argument lists for macros if [-Wgnu-zero-variadic-macro-arguments](https://releases.llvm.org/17.0.1/tools/clang/docs/DiagnosticsReference.html#id380) is activated. This warning is wrong when compiling for C++ 20 or later mode. C++ 20 and later explicitly allow empty variadic argument lists for macros: https://eel.is/c++draft/cpp.replace.general#5
> If the [identifier-list](https://eel.is/c++draft/cpp.pre#nt:identifier-list) in the macro definition does not end with an ellipsis, the number of arguments (including those arguments consisting of no preprocessing tokens) in an invocation of a function-like macro shall equal the number of parameters in the macro definition[.](https://eel.is/c++draft/cpp.replace.general#5.sentence-1)
Otherwise, there shall be **at least as many arguments in the invocation as there are parameters in the macro definition (excluding the ...)**[.](https://eel.is/c++draft/cpp.replace.general#5.sentence-2)
There shall exist a ) preprocessing token that terminates the invocation[.](https://eel.is/c++draft/cpp.replace.general#5.sentence-3)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM1u4zYQfhr6MpAgUZZ_Djo4yRroqUCxQM8jaiRNlyJVDpXEffqCWiWbDdJiWyxg2KA55PcnfSjCgyNqVH2n6ocdLnH0oRlRhOw07Vrf3Zp7i26AJwxOAFu_RKBpjjd4xMDYsQEMwzKRi2BZokDvA0xoghfgHlR9l_0-uCX7i4LPXs5k60D2clJU_aD0aYxxFlVdlL4qfQ1kCYUkt_Zxyn0YlL6Wx7zIS6Wv0XsrSl9NIqf0tfMmLR8YB-clspHfqKdAzlA-xskqXXFXnQqlz8ACaCI_YqQuh88jy6qO3ZC2noJPckdyYPw0s03_J033St-lzyetToW6XHUBPoDFSAEm31H-0QS6bhuh59my4WhvgNb6px92UVUX-N4ZIpvzqv4rYBewj2k5z3mg2aKhfCBHAZPuWhUPqrhs39Un-KWHOFJKhjtykXumkCXUj1L4N6w5kNKVi6q6vL8p2exWmFUEdNSz48jeQedJwPkI5Dp44jgCOiBreZYEdL-ecsvUUgDfv_oioPSJnbFLlxKJoxd6s2m8E5aYtnwPzsMcaA7ekMg67r-Qk40WOmD36A2ufBIG9IszaZVZ_vLCWUa0FujPBe07TjMGnChSkH9Sqeq7_L_a-UF0uZCL6SHOSqXPXyP8NY4Unlho8yrQxrQlUPqi9AUjpFcnAgpM6G5vbNrovpGPsl2CgX5AWEqBnr-lQJDneeK2Iv902fpV9uc3SumZkzpIeX6QM8QRI0QKEzuMJO8k_3SSldLnXddU3bk6446a8lhU9f54KPe7sSmK4nCqivZcd6fiWBeky3Z_xBJP50OJh9OOG13oqtS61tW-KPf5wRhsD1R3p7bsDbZqX9CEbF-LcMciCzXHQ3WsdxZbsrI2uNZbHepU5qFJ81m7DKL2xdoq326IHC29VHtqPHv7XxW_W4Jtvrdx4DgubW78pPQ1AW4_2Rz8H2SSoyv_5PQq4e8AAAD___ZmLU0">