summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/context.rs2
-rw-r--r--src/ir/ty.rs20
2 files changed, 15 insertions, 7 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs
index fa001ba6..6c11f7f9 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -425,6 +425,8 @@ impl<'ctx> BindgenContext<'ctx> {
let _resolved = {
let resolved = Item::from_ty(&ty, loc, parent_id, self)
.unwrap_or_else(|_| {
+ warn!("Could not resolve type reference, falling back \
+ to opaque blob");
Item::new_opaque_type(self.next_item_id(), &ty, self)
});
let mut item = self.items.get_mut(&id).unwrap();
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index a28727c9..594e4c03 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -1093,13 +1093,19 @@ impl Type {
name = location.spelling();
}
- if let Ok(complex) = CompInfo::from_ty(potential_id,
- ty,
- Some(location),
- ctx) {
- TypeKind::Comp(complex)
- } else {
- return Ok(ParseResult::New(Opaque::from_clang_ty(ty), None));
+ let complex = CompInfo::from_ty(potential_id,
+ ty,
+ Some(location),
+ ctx);
+ match complex {
+ Ok(complex) => TypeKind::Comp(complex),
+ Err(_) => {
+ warn!("Could not create complex type \
+ from class template or base \
+ specifier, using opaque blob");
+ let opaque = Opaque::from_clang_ty(ty);
+ return Ok(ParseResult::New(opaque, None));
+ }
}
}
CXCursor_TypeAliasTemplateDecl => {