[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 19 14:43:55 PDT 2024


Sirraide wrote:

> @Sirraide, I noticed the following build issue when new compiler with this change (bootstrap compiler) is being used to build one of the files for `clangd`:
> 
> ```
> .../clang-tools-extra/clangd/unittests/FindTargetTests.cpp:430:29: error: passing no argument for the '...' parameter of a variadic macro is a C++20 extension [-Werror,-Wc++20-extensions]
>   430 |   EXPECT_DECLS("AutoTypeLoc");
>       |                             ^
> .../clang-tools-extra/clangd/unittests/FindTargetTests.cpp:98:9: note: macro 'EXPECT_DECLS' defined here
>    98 | #define EXPECT_DECLS(NodeType, ...)                                            \
>       |         ^
> ```
> 
> Do you have suggestion how to fix it or even better provie the fix? Thank you, Zibi

I mean, from what I can tell, this isn’t a Clang issue but rather just a result of this code here not being standards-compliant C++17. Before C++20, afaik the ‘fix’ for this is to have two different macros: one variadic, one not variadic. It’s not pretty, but that’s why that got changed in C++20.

https://github.com/llvm/llvm-project/pull/84520


More information about the cfe-commits mailing list