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 emilio committed Jan 12, 2024
1 parent ba54134 commit aaa8883
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bindgen/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,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 aaa8883

Please sign in to comment.