diff --git a/bindgen/ir/comp.rs b/bindgen/ir/comp.rs index 0b50bf3244..f0c4e6f03c 100644 --- a/bindgen/ir/comp.rs +++ b/bindgen/ir/comp.rs @@ -1234,6 +1234,12 @@ impl CompInfo { ); let mut cursor = ty.declaration(); + + // If there is a definition, that's what we want. + if let Some(def) = cursor.definition() { + cursor = def; + } + let mut kind = Self::kind_from_cursor(&cursor); if kind.is_err() { if let Some(location) = location {