Skip to content

ast-exporter: Do not process macros for the syntactic form of InitListExpr#1826

Open
Rua wants to merge 1 commit into
immunant:masterfrom
Rua:macro-ile-fix
Open

ast-exporter: Do not process macros for the syntactic form of InitListExpr#1826
Rua wants to merge 1 commit into
immunant:masterfrom
Rua:macro-ile-fix

Conversation

@Rua
Copy link
Copy Markdown
Contributor

@Rua Rua commented May 25, 2026

In the exporter, the macroCallSites variable keeps track of which macro call sites have already been visited, so that only the outermost expression gets processed for that call site. But that depends on Clang's visiting order, and in the case of init lists, the syntactic form appears to be visited first, which then prevents macros from being associated with the semantic form. This PR skips macro processing for the syntactic form (which c2rust ignores anyway), fixing expansion for init lists in the transpiler.

@Rua Rua force-pushed the macro-ile-fix branch from 745974e to 5d4a8e9 Compare May 25, 2026 14:28
Copy link
Copy Markdown
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

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