Skip to content

Conversation

glankk
Copy link
Contributor

@glankk glankk commented Jun 30, 2025

Fixes __VA_OPT__ by expanding it first, before further recursive expansions in variadic macros.

When a variadic macro containing a __VA_OPT__ token is parsed, the macro is split into a different token list for the two possible cases, where each occurence of __VA_OPT__ is either expanded and discarded. The correct token list is selected during macro expansion by examining the number of arguments, this way most of the extra processing required is only done once during the macro parsing, and only for variadic macros containing __VA_OPT__.

@danmar danmar merged commit 8f8bfe3 into danmar:master Jul 1, 2025
16 checks passed
@glankk glankk deleted the 368 branch July 1, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants