summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parser.rs9
-rw-r--r--tests/headers/class_with_typedef.hpp5
2 files changed, 13 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 75519a64..02dbd6d2 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -661,7 +661,7 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor,
}
CXCursor_CXXBaseSpecifier => {
let ty = conv_ty(ctx, &cursor.cur_type(), cursor);
- let fieldname = if ci.members.len() > 0 {
+ let fieldname = if !ci.members.is_empty() {
format!("_base{}", ci.members.len())
} else {
"_base".to_string()
@@ -684,6 +684,9 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor,
} else {
ci.members.push(CompMember::Field(field));
}
+ if let TComp(ref info) = ty {
+ ci.typedefs.extend(info.borrow().typedefs.clone().into_iter());
+ }
ci.base_members += 1;
}
CXCursor_CXXMethod => {
@@ -887,6 +890,10 @@ fn visit_top(cursor: &Cursor,
CXChildVisit_Continue
}
CXCursor_FunctionDecl => {
+ if ctx.options.ignore_functions {
+ return CXChildVisit_Continue;
+ }
+
let linkage = cursor.linkage();
if linkage != CXLinkage_External && linkage != CXLinkage_UniqueExternal {
return CXChildVisit_Continue;
diff --git a/tests/headers/class_with_typedef.hpp b/tests/headers/class_with_typedef.hpp
index 6055283f..0dbc71ec 100644
--- a/tests/headers/class_with_typedef.hpp
+++ b/tests/headers/class_with_typedef.hpp
@@ -8,3 +8,8 @@ public:
AnotherInt d;
AnotherInt* other_ptr;
};
+
+class D: public C {
+public:
+ MyInt* ptr;
+};