summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/template.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/ir/template.rs b/src/ir/template.rs
index 5861929f..5c570996 100644
--- a/src/ir/template.rs
+++ b/src/ir/template.rs
@@ -233,11 +233,22 @@ impl TemplateInstantiation {
let template_args = ty.template_args()
.map_or(vec![], |args| {
- args.filter(|t| t.kind() != CXType_Invalid)
- .map(|t| {
- Item::from_ty_or_ref(t, t.declaration(), None, ctx)
- })
- .collect()
+ match ty.canonical_type().template_args() {
+ Some(canonical_args) => {
+ let arg_count = args.len();
+ args.chain(canonical_args.skip(arg_count))
+ .filter(|t| t.kind() != CXType_Invalid)
+ .map(|t| {
+ Item::from_ty_or_ref(t, t.declaration(), None, ctx)
+ }).collect()
+ }
+ None => {
+ args.filter(|t| t.kind() != CXType_Invalid)
+ .map(|t| {
+ Item::from_ty_or_ref(t, t.declaration(), None, ctx)
+ }).collect()
+ }
+ }
});
let definition = ty.declaration()