diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-04-04 13:24:39 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-04-04 13:30:52 -0700 |
commit | eaf638b539a0df64a6468b633850a3acb09e3f95 (patch) | |
tree | 8880f5d859a7bf372bb25ba07a51184e924d9353 | |
parent | 9d8c338dcfcab0402d0b10fc0c929ef909ee8164 (diff) |
Use opaque types rather than continuing when template instantiation fails
-rw-r--r-- | src/ir/ty.rs | 9 | ||||
-rw-r--r-- | tests/expectations/tests/builtin-template.rs | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs index f1485638..84a15614 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs @@ -988,11 +988,10 @@ impl Type { (ty.template_args().is_some() && ty_kind != CXType_Typedef) { // This is a template instantiation. - let inst = match TemplateInstantiation::from_ty(&ty, ctx) { - Some(inst) => inst, - None => return Err(ParseError::Continue), - }; - TypeKind::TemplateInstantiation(inst) + match TemplateInstantiation::from_ty(&ty, ctx) { + Some(inst) => TypeKind::TemplateInstantiation(inst), + None => TypeKind::Opaque, + } } else { match ty_kind { CXType_Unexposed if *ty != canonical_ty && diff --git a/tests/expectations/tests/builtin-template.rs b/tests/expectations/tests/builtin-template.rs index 1215f9da..44cda83c 100644 --- a/tests/expectations/tests/builtin-template.rs +++ b/tests/expectations/tests/builtin-template.rs @@ -4,4 +4,4 @@ #![allow(non_snake_case)] -pub type std_make_integer_sequence<T> = T; +pub type std_make_integer_sequence = u8; |