summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-02-03 09:59:22 -0800
committerGitHub <noreply@github.com>2017-02-03 09:59:22 -0800
commiteede09e5b3d77adde2c25721e376eb387c43592e (patch)
tree6f7c201675ea3dd851e92f209788b0dd3e406d16 /src
parent4c45407aba15f81bc5fb19650bb8c14e51548519 (diff)
parent439d89dd62b8f2c6f5f124c4d4feb4cabce53339 (diff)
Auto merge of #470 - emilio:template-fun-ty, r=fitzgen
Fix a recent template-specialization-related regression. r? @upsuper
Diffstat (limited to 'src')
-rw-r--r--src/clang.rs14
-rw-r--r--src/ir/ty.rs3
2 files changed, 10 insertions, 7 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 63f9123e..85e1ba1f 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -787,12 +787,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 1246057b..e3f7c8ef 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -622,7 +622,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");