Skip to content

Commit

Permalink
Handle CXCursor_LinkageSpec in Clang 18+
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay authored and MrAlex94 committed May 28, 2024
1 parent e5b5c07 commit 609e3a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions third_party/rust/bindgen/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,8 +1428,11 @@ impl Item {
}

match cursor.kind() {
// Guess how does clang treat extern "C" blocks?
CXCursor_UnexposedDecl => Err(ParseError::Recurse),
// On Clang 18+, extern "C" is reported accurately as a LinkageSpec.
// Older LLVM treat it as UnexposedDecl.
CXCursor_LinkageSpec | CXCursor_UnexposedDecl => {
Err(ParseError::Recurse)
}

// We allowlist cursors here known to be unhandled, to prevent being
// too noisy about this.
Expand Down

0 comments on commit 609e3a4

Please sign in to comment.