diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-02-03 13:55:53 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-02-03 13:55:53 +0100 |
commit | 876c5a29a297edfc3b90dbb84e1c303deb64bcc2 (patch) | |
tree | 94ef4f5d5be53115e61f6d49e521a92580135525 /src | |
parent | 63d83982e963bbdb1150508e53888e10f0320594 (diff) |
clang: Make the is_fully_specialized_template check less insane.
This fixes a regression with stylo bindings after the function pointer PR.
Diffstat (limited to 'src')
-rw-r--r-- | src/clang.rs | 14 | ||||
-rw-r--r-- | src/ir/ty.rs | 3 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/clang.rs b/src/clang.rs index 9cf51436..b436a78d 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -778,12 +778,14 @@ impl Type { // Yep, the spelling of this containing type-parameter is extremely // nasty... But can happen in <type_traits>. Unfortunately I couldn't // reduce it enough :( - !self.spelling().contains("type-parameter") && - self.template_args() - .map_or(false, |mut args| { - args.len() > 0 && - !args.any(|t| t.spelling().contains("type-parameter")) - }) + self.template_args().map_or(false, |args| { + args.len() > 0 + }) && match self.declaration().kind() { + CXCursor_ClassTemplatePartialSpecialization | + CXCursor_TypeAliasTemplateDecl | + CXCursor_TemplateTemplateParameter => false, + _ => true, + } } } diff --git a/src/ir/ty.rs b/src/ir/ty.rs index 5474aa57..cb566fb3 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs @@ -602,7 +602,8 @@ impl Type { // Same here, with template specialisations we can safely // assume this is a Comp(..) } else if ty.is_fully_specialized_template() { - debug!("Template specialization: {:?}", ty); + debug!("Template specialization: {:?}, {:?} {:?}", + ty, location, canonical_ty); let complex = CompInfo::from_ty(potential_id, ty, location, ctx) .expect("C'mon"); |