Skip to content

Commit 876c5a2

Browse files
committed
clang: Make the is_fully_specialized_template check less insane.
This fixes a regression with stylo bindings after the function pointer PR.
1 parent 63d8398 commit 876c5a2

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/clang.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,14 @@ impl Type {
778778
// Yep, the spelling of this containing type-parameter is extremely
779779
// nasty... But can happen in <type_traits>. Unfortunately I couldn't
780780
// reduce it enough :(
781-
!self.spelling().contains("type-parameter") &&
782-
self.template_args()
783-
.map_or(false, |mut args| {
784-
args.len() > 0 &&
785-
!args.any(|t| t.spelling().contains("type-parameter"))
786-
})
781+
self.template_args().map_or(false, |args| {
782+
args.len() > 0
783+
}) && match self.declaration().kind() {
784+
CXCursor_ClassTemplatePartialSpecialization |
785+
CXCursor_TypeAliasTemplateDecl |
786+
CXCursor_TemplateTemplateParameter => false,
787+
_ => true,
788+
}
787789
}
788790
}
789791

src/ir/ty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,8 @@ impl Type {
602602
// Same here, with template specialisations we can safely
603603
// assume this is a Comp(..)
604604
} else if ty.is_fully_specialized_template() {
605-
debug!("Template specialization: {:?}", ty);
605+
debug!("Template specialization: {:?}, {:?} {:?}",
606+
ty, location, canonical_ty);
606607
let complex =
607608
CompInfo::from_ty(potential_id, ty, location, ctx)
608609
.expect("C'mon");

0 commit comments

Comments
 (0)