diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/codegen/mod.rs | 3 | ||||
-rw-r--r-- | src/ir/comp.rs | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 55312c31..17789e19 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1444,7 +1444,8 @@ impl ToRustTy for Type { if inner_ty.canonical_type(ctx).is_function() { ty } else { - ty.to_ptr(inner.expect_type().is_const(), ctx.span()) + let is_const = self.is_const() || inner.expect_type().is_const(); + ty.to_ptr(is_const, ctx.span()) } } TypeKind::Named(..) => { diff --git a/src/ir/comp.rs b/src/ir/comp.rs index 1f8a0292..9d1a6366 100644 --- a/src/ir/comp.rs +++ b/src/ir/comp.rs @@ -547,8 +547,8 @@ impl CompInfo { let default_type = Item::from_ty(&cur.cur_type(), Some(*cur), Some(potential_id), ctx).ok(); - - let param = Item::named_type(cur.spelling(), default_type, potential_id, ctx); + let param = Item::named_type(cur.spelling(), default_type, + potential_id, ctx); ci.template_args.push(param); } CXCursor_CXXBaseSpecifier => { |