Skip to content
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

Check if clang_Type_getNumTemplateArguments is loaded before use #916

Merged

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Aug 15, 2017

Older clang don't have it, and while we can't pass our whole test suite with those older clangs, we can still generate simple C bindings, so it makes sense not to panic for C++ only things.

src/clang.rs Outdated
@@ -833,6 +833,10 @@ impl Type {
/// Get the number of template arguments this type has, or `None` if it is
/// not some kind of template.
pub fn num_template_args(&self) -> Option<u32> {
if !clang_Type_getNumTemplateArguments::is_loaded() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment on this, saying that it's not correct but that that shouldn't block C bindings from working?

Older clang don't have it, and while we can't pass our whole test suite with
those older clangs, we can still generate simple C bindings, so it makes sense
not to panic for C++ only things.
@fitzgen fitzgen force-pushed the check-if-num-template-args-is-loaded branch from 19fff3e to b6c7592 Compare August 16, 2017 22:35
@fitzgen
Copy link
Member Author

fitzgen commented Aug 16, 2017

@bors-servo r+

Thanks for review!

@bors-servo
Copy link

📌 Commit b6c7592 has been approved by fitzgen

@bors-servo
Copy link

⌛ Testing commit b6c7592 with merge 333dc1d...

bors-servo pushed a commit that referenced this pull request Aug 16, 2017
…fitzgen

Check if `clang_Type_getNumTemplateArguments` is loaded before use

Older clang don't have it, and while we can't pass our whole test suite with those older clangs, we can still generate simple C bindings, so it makes sense not to panic for C++ only things.
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 333dc1d to master...

@bors-servo bors-servo merged commit b6c7592 into rust-lang:master Aug 16, 2017
@stouset
Copy link
Contributor

stouset commented Apr 5, 2018

This bug seems to have been regressed due to eeec4bd from #915 .

@stouset stouset mentioned this pull request Apr 5, 2018
@fitzgen fitzgen deleted the check-if-num-template-args-is-loaded branch April 6, 2018 16:45
bors-servo pushed a commit that referenced this pull request May 29, 2018
…=emilio

Check if `clang_Type_getNumTemplateArguments` is loaded before use

Fixes #1304, which reapplies #916 which was regressed by #915.
kulp added a commit to kulp/rust-bindgen that referenced this pull request Jun 22, 2020
It is not clear what version of libclang these supported.

Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
kulp added a commit to kulp/rust-bindgen that referenced this pull request Jun 24, 2020
It is not clear what version of libclang these supported.

Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
kulp added a commit to kulp/rust-bindgen that referenced this pull request Jun 28, 2020
It is not clear what version of libclang these supported.

Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
kulp added a commit to kulp/rust-bindgen that referenced this pull request Jun 29, 2020
It is not clear what version of libclang these supported.

Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
kulp added a commit to kulp/rust-bindgen that referenced this pull request Jul 17, 2020
It is not clear what version of libclang these supported.

Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
kulp added a commit to kulp/rust-bindgen that referenced this pull request Jul 20, 2020
It is not clear what version of libclang these supported.

Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
emilio pushed a commit that referenced this pull request Jul 20, 2020
It is not clear what version of libclang these supported.

Refer to #1321, #1304, #916, #915.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants