-
Notifications
You must be signed in to change notification settings - Fork 758
Avoid mangling name for tpl class member. Fix #68 #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid mangling name for tpl class member. Fix #68 #69
Conversation
Hmm... So I though this avoided getting the mangling for unspecialized methods, but this also avoids that in specialized methods. I'm fine with not getting symbols for non-specialized templates, because it makes no particular sense (and I guess are the ones that crash), but I guess we can still parse the ones for specialized templates? (Though I think we don't use them yet?). TLDR: Does a check like |
Otherwise I'm fine with merging this, I guess. |
Oh, and thanks for digging into this btw :-) |
The minimal reproduce code is: template<class M> struct A;
template<class C> struct A<void(C::*)()> { static int v; }; and it crashes at the static variable |
Well, it's not specialized completely, since you still don't know the Does something like: template<class M> struct A;
template<>
struct A<int> {
static int foo;
}; still crash? |
Also, even if it still crashes, can you add a comment on the |
That doesn't crash. But how can we check whether one template is fully specialized? It seems to me |
Hm... that's right. I think you can do: fn is_complete_template_specialization(&self) -> bool {
self.is_template() && self.num_template_args() > 0
} Since the last method only works for complete specializations. |
5936500
to
3f27469
Compare
3f27469
to
dd5962b
Compare
return false; | ||
} | ||
let parent = self.semantic_parent(); | ||
(parent.is_template() && !parent.is_fully_specialized_template()) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can drop the parent.is_template()
check here, since is already part of is_fully_specialized_template()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't, because is_fully_specialized_template()
is negated, so if you remove parent.is_template()
, it would return true
for non-templates.
r=me with that @bors-servo: delegate+ |
✌️ @upsuper can now approve this pull request |
You're right, @bors-servo: r+ |
📌 Commit dd5962b has been approved by |
⚡ Test exempted - status |
Avoid mangling name for tpl class member. Fix #68 Not sure whether it is the right thing to do.
Not sure whether it is the right thing to do.