https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101488
Bug ID: 101488 Summary: Implement p1042r1 __VA_OPT__ placemarker changes Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- With the https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575355.html there are still some pending placemarker changes that need to be done for full C++20 __VA_OPT__ support. Testcases include besides c-c++-common/cpp/va-opt* also e.g. #define A(x,...) a ## __VA_OPT__ (a) ## a #define B(x,...) a ## __VA_OPT__ () ## a #define C(x,...) a ## __VA_OPT__ (x) ## a #define D(x,...) a ## __VA_OPT__ (x##x) ## a #define E(x,...) a ## __VA_OPT__ (x##x 1) ## a #define F(x,...) a ## __VA_OPT__ (1 x##x) ## a v1: A(,) v2: A(,1) v3: A(2,1) v4: B(,) v5: B(,1) v6: B(2,1) v7: C(,) v8: C(,1) v9: C(2,1) v10: D(,) v11: D(,1) v12: D(2,1) v13: E(,) v14: E(,1) v15: E(2,1) v16: F(,) v17: F(,1) v18: F(2,1) or clang/test/Preprocessor/macro_vaopt_expand.cpp and clang/test/Preprocessor/macro_vaopt_p1042r1.cpp On the above testcase, trunk with the #__VA_OPT__ patch to clang difference is: -v14: a1a +v14: a 1a -v17: a1a +v17: a1 a On the macro_vaopt_expand.cpp testcase, the difference between patched trunk and clang is -26: B1 -26_1: B1 +26: B 1 +26_1: B 1 -27: B11 +27: B 11 -28: B11 +28: B 11 and on the macro_vaopt_p1042r1.cpp testcase the difference is: -4: ab +4: a b -4B: ab +4B: a b