Date: Fri, 1 Nov 2019 03:12:39 -0400
My original message became garbled somehow with a strange symbol instead
of a space so I will try again.
Given:
#define NO_DATA
#define TRY_VA_OPT(...) __VA_OPT__ (0) 1
granted that TRY_VA_OPT() expands to 1, what does TRY_VA_OPT(NO_DATA)
expand to ?
I would have thought that it also expands to 1 but gcc-9.2 in C++20 mode
expands it to 0 1 while clang-9.0 in C++20 expands it to 1. In trying to
interpret 15.6.1 paragraph 3 of n4835 it seems to me that the
determination of whether or not the __VA_OPT__ construct expands to a
single placemarker token or its pp-tokens should be made based on the
variadic parameter argument(s) after they are fully macro replaced,
since all occurrences of __VA_ARGS__ in the replacement list occur after
the variadic parameter argument(s) are fully macro replaced, just like
any other parameter in the replacement list.
What is the correct interpretation of how this should work ?
of a space so I will try again.
Given:
#define NO_DATA
#define TRY_VA_OPT(...) __VA_OPT__ (0) 1
granted that TRY_VA_OPT() expands to 1, what does TRY_VA_OPT(NO_DATA)
expand to ?
I would have thought that it also expands to 1 but gcc-9.2 in C++20 mode
expands it to 0 1 while clang-9.0 in C++20 expands it to 1. In trying to
interpret 15.6.1 paragraph 3 of n4835 it seems to me that the
determination of whether or not the __VA_OPT__ construct expands to a
single placemarker token or its pp-tokens should be made based on the
variadic parameter argument(s) after they are fully macro replaced,
since all occurrences of __VA_ARGS__ in the replacement list occur after
the variadic parameter argument(s) are fully macro replaced, just like
any other parameter in the replacement list.
What is the correct interpretation of how this should work ?
Received on 2019-11-01 02:14:58