-
Notifications
You must be signed in to change notification settings - Fork 748
Do not evaluate variadic template types #284
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
Do not evaluate variadic template types #284
Conversation
04384c3
to
80ac773
Compare
Rebased and fixed the merge conflict :) |
80ac773
to
e3649e2
Compare
This is a workaround for an internal clang assertion that gets triggered if we try to evaluate a variadic template type reference. Fixes rust-lang#283
e3649e2
to
1c18ec7
Compare
// `CXType_Unexposed` from evaluation. | ||
let mut found_cant_eval = false; | ||
cursor.visit(|c| { | ||
if c.kind() == CXCursor_TypeRef && c.cur_type().kind() == CXType_Unexposed { |
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.
FWIW I don't think recursing here is needed given the callers. Probably something like:
if cursor.semantic_parent().kind() == CXCursor_ClassTemplate
Could be enough for our use case, but anyway it's fine.
Please add in the comment the issue number, and add a comment in new
saying that this could be relatively expensive to call if mis-called.
r=me in any case. Thanks!
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.
The semantic parent ends up being a CXCursor_VarDecl
and then that cursor's semantic parent is a CXCursor_ClassTemplate
. I think the existing check is probably better than looking for a VarDecl
-> ClassTemplate
inheritence, although neither is satisfying.
@bors-servo r=emilio |
📌 Commit 1c18ec7 has been approved by |
☀️ Test successful - status-travis |
This is a workaround for an internal clang assertion that gets triggered
if we try to evaluate a variadic template type reference.
Fixes #283
r? @emilio