Skip to content

C++: sort types topologically before emitting definitions#1619

Merged
alexcrichton merged 3 commits into
bytecodealliance:mainfrom
dicej:fix-1615
May 27, 2026
Merged

C++: sort types topologically before emitting definitions#1619
alexcrichton merged 3 commits into
bytecodealliance:mainfrom
dicej:fix-1615

Conversation

@dicej
Copy link
Copy Markdown
Collaborator

@dicej dicej commented May 27, 2026

Specifically, we sort the types while taking the parameter and return types of resource functions into consideration. This ensures that types are declared (and, if necessary, defined) before they are used in the emitted source code.

Fixes #1615

@dicej dicej requested a review from cpetig May 27, 2026 20:15
Specifically, we sort the types while taking the parameter and return types of
resource functions into consideration.  This ensures that types are declared
(and, if necessary, defined) before they are used in the emitted source code.

Fixes bytecodealliance#1615
Comment thread crates/cpp/src/lib.rs Outdated
Comment thread crates/cpp/src/lib.rs Outdated
@alexcrichton alexcrichton enabled auto-merge May 27, 2026 22:20
@alexcrichton alexcrichton added this pull request to the merge queue May 27, 2026
Merged via the queue into bytecodealliance:main with commit d635117 May 27, 2026
56 of 58 checks 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.

C++: undeclared identifier errors building generated code

2 participants