diff options
-rw-r--r-- | src/parser.rs | 4 | ||||
-rw-r--r-- | tests/headers/class_with_typedef.hpp | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs index 02dbd6d2..d0d23895 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -439,7 +439,7 @@ fn conv_ty_resolving_typedefs(ctx: &mut ClangParserCtx, CXType_Typedef | CXType_Unexposed | CXType_Enum => conv_decl_ty_resolving_typedefs(ctx, ty, cursor, resolve_typedefs), - CXType_ConstantArray => TArray(Box::new(conv_ty(ctx, &ty.elem_type(), cursor)), ty.array_size(), layout), + CXType_ConstantArray => TArray(Box::new(conv_ty_resolving_typedefs(ctx, &ty.elem_type(), cursor, resolve_typedefs)), ty.array_size(), layout), _ => { let fail = ctx.options.fail_on_unknown_type; log_err_warn(ctx, @@ -541,7 +541,7 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor, // XXX make it more consistent let type_spelling = cursor.cur_type().spelling() .replace("const ", "") - .replace(" *", ""); + .split(' ').next().unwrap_or("").to_owned(); let is_class_typedef = ci.typedefs.iter().any(|spelling| *spelling == *type_spelling); let ty = conv_ty_resolving_typedefs(ctx, &cursor.cur_type(), cursor, is_class_typedef); diff --git a/tests/headers/class_with_typedef.hpp b/tests/headers/class_with_typedef.hpp index 0dbc71ec..c67f7623 100644 --- a/tests/headers/class_with_typedef.hpp +++ b/tests/headers/class_with_typedef.hpp @@ -5,6 +5,7 @@ public: typedef int MyInt; MyInt c; MyInt* ptr; + MyInt arr[10]; AnotherInt d; AnotherInt* other_ptr; }; |