summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Taylor <adetaylor@chromium.org>2021-05-18 06:51:52 -0700
committerGitHub <noreply@github.com>2021-05-18 15:51:52 +0200
commitb60339ece3994868a55889b7f1f6043ab29ba30e (patch)
treee2663e59f133f79c5f776f6630e2fed4dcd65e0e /src
parente6684dc5c56d0283b9c14b34f68d445e9d5a580f (diff)
Identify forward declarations in params. (#2052)
Diffstat (limited to 'src')
-rw-r--r--src/clang.rs2
-rw-r--r--src/ir/comp.rs1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 96f77254..db6467e3 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -241,7 +241,7 @@ impl Cursor {
self.x.kind
}
- /// Returns true is the cursor is a definition
+ /// Returns true if the cursor is a definition
pub fn is_definition(&self) -> bool {
unsafe { clang_isCursorDefinition(self.x) != 0 }
}
diff --git a/src/ir/comp.rs b/src/ir/comp.rs
index 52dcddd5..d57c272a 100644
--- a/src/ir/comp.rs
+++ b/src/ir/comp.rs
@@ -1249,6 +1249,7 @@ impl CompInfo {
let mut ci = CompInfo::new(kind);
ci.is_forward_declaration =
location.map_or(true, |cur| match cur.kind() {
+ CXCursor_ParmDecl => true,
CXCursor_StructDecl | CXCursor_UnionDecl |
CXCursor_ClassDecl => !cur.is_definition(),
_ => false,