diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-06 10:32:21 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-06 10:32:21 +0100 |
commit | 6720a9930a28d5daf8303d5cf6a957f86765b988 (patch) | |
tree | dbbb4be590052e3281a8b2c9a9aa42f1169addf2 | |
parent | bf1c41dc627f26a782c948868a5f270235d58725 (diff) |
ir: More appropriately track whether we're inheriting virtually.
-rw-r--r-- | libbindgen/src/ir/comp.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libbindgen/src/ir/comp.rs b/libbindgen/src/ir/comp.rs index b9f71241..2740fe8f 100644 --- a/libbindgen/src/ir/comp.rs +++ b/libbindgen/src/ir/comp.rs @@ -617,16 +617,22 @@ impl CompInfo { ci.template_args.push(param); } CXCursor_CXXBaseSpecifier => { - if !ci.has_vtable { - ci.has_vtable = cur.is_virtual_base(); - } + let is_virtual_base = cur.is_virtual_base(); + ci.has_vtable |= is_virtual_base; + + let kind = if is_virtual_base { + BaseKind::Virtual + } else { + BaseKind::Normal + }; + let type_id = Item::from_ty_or_ref(cur.cur_type(), Some(cur), None, ctx); ci.base_members.push(Base { ty: type_id, - kind: BaseKind::Normal + kind: kind, }); } CXCursor_Constructor | |