veselink1 / refl-cpp

Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).
https://veselink1.github.io/refl-cpp/md__introduction.html
MIT License
1.05k stars 76 forks source link

Fix warnings for strict variadic macro checks (stronger C++20 enforcement) #63

Open RalphSteinhagen opened 2 years ago

RalphSteinhagen commented 2 years ago

While code-base spring cleaning I noticed that I (unwisely) ignored some refl-cpp variadic macro warnings that prevent gcc|clang compiling with more strict checks enabled (i.e. -Werror).

This shows up already for C++17 with the existing basic refl-cpp's default serialiser example and -pedantic compiler flags. The corresponding sample output and warnings from running the tests at compiler-explorer:

These checks seem to become more enforced for but also there seems to be a clean solution for C++20 #define FOO(x, ...) bar(x __VA_OPT__(,) __VA_ARGS__) as, for example, discussed in more detail here. I was wondering whether this could be addressed under the premise that refl-cpp is C++17-based?

Any help would be much appreciated! Thanks in advance!