Skip to content

Fix empty variadic macros dropping LHS of token pasting#471

Merged
SpaceManiac merged 1 commit into
SpaceManiac:masterfrom
hry-gh:dont-drop-lhs
Jul 4, 2026
Merged

Fix empty variadic macros dropping LHS of token pasting#471
SpaceManiac merged 1 commit into
SpaceManiac:masterfrom
hry-gh:dont-drop-lhs

Conversation

@hry-gh

@hry-gh hry-gh commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

say you were wanting to do something like

#define MACRO_THAT_MAKES_A_VAR(var_name, var_type...) var##var_type/##var_name

/proc/foo()
  MACRO_THAT_MAKES_A_VAR(some_primitive) // var/some_primitive
  MACRO_THAT_MAKES_A_VAR(typed_var, /client) // /var/client/some_primitive

we currently drop the var from the expression, and would just emit /some_primitive

@SpaceManiac SpaceManiac changed the title using variadic macros can drop the lhs of an expression if a variadic macro is empty Fix empty variadic macros dropping LHS of token pasting Jul 4, 2026
@SpaceManiac SpaceManiac merged commit 33becef into SpaceManiac:master Jul 4, 2026
1 check passed
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