Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle CXCursor_LinkageSpec in Clang 18+ #2689

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 28, 2023

Context:

Past versions of Clang have a longstanding bug (11+ years; see https://stackoverflow.com/questions/11865486/clang-ast-extern-linkagespec-issue) of clang::getCursorKindForDecl reporting linkage specifications such as extern "C" as CXCursor_UnexposedDecl, rather than CXCursor_LinkageSpec.

This was recently fixed in Clang 18, which breaks bindgen by making all extern "C" decls invisible to bindgen. Bindgen just generates nothing.

This PR makes bindgen compatible with Clang 18 by treating CXCursor_LinkageSpec the same as the old CXCursor_UnexposedDecl.

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@emilio emilio merged commit 86f3dbe into rust-lang:main Nov 28, 2023
32 checks passed
@dtolnay dtolnay deleted the linkagespec branch November 28, 2023 23:08
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 1, 2023
aosmond pushed a commit to aosmond/gecko that referenced this pull request Dec 1, 2023
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 7, 2023
… r=emilio,supply-chain-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D195060

UltraBlame original commit: 160bfd7365875ceea03d8b499ea08ee9051d9239
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 7, 2023
… r=emilio,supply-chain-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D195060

UltraBlame original commit: 160bfd7365875ceea03d8b499ea08ee9051d9239
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 7, 2023
… r=emilio,supply-chain-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D195060

UltraBlame original commit: 160bfd7365875ceea03d8b499ea08ee9051d9239
pld-gitsync pushed a commit to pld-linux/thunderbird that referenced this pull request Apr 17, 2024
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