You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The definition seems pretty exotic so I suppose that something in it is unsupported.
Bindgen Invocation
// Generate the bindingslet bindings = bindgen::Builder::default().generate_inline_functions(true).derive_default(true).header("./seal/src/seal/seal.h").clang_arg("-I./seal/src/").clang_arg("-std=c++17").clang_arg("-x").clang_arg("c++").opaque_type("std::.*").whitelist_type("seal::.*").whitelist_function("seal::.*").generate().expect("Unable to generate bindings");
Actual Results
The bindings.rs file has an undefined T value in IntArray:
For now, I have found that simply replacing T by u64 (since it's the only type they used as T in their code) works, but ideally I wouldn't have to edit the bindings by hand.
Not OP, but I thought to run this through creduce.
I dumped preprocessor output for just src/seal/intarray.h which is not in master but is in the prior commit referenced above.
Running creduce with a predicate that runs bindgen master with --bindgen-args "--opaque-type std::.* --whitelist-type seal::.* --whitelist-function seal::.* -- -std=c++17 -x c++" produced this reduced header:
template <bool> struct a;
template <bool b> using c = typename a<b>::d;
namespace seal {
template <typename e, typename = c<e ::f>> class g { e h; };
template <typename e> class IntArray { g<e> h; };
} // namespace seal
bindgen --whitelist-type seal::.* bindgen.ii -- -x c++ -std=c++17
error[E0412]: cannot find type `e` in this scope
--> bindings.rs:12:19
|
11 | pub struct seal_IntArray {
| - help: you might be missing a type parameter: `<e>`
12 | pub h: seal_g<e>,
| ^ not found in this scope
error[E0412]: cannot find type `e` in this scope
--> bindings.rs:12:19
|
12 | pub h: seal_g<e>,
| ^ not found in this scope
Input C/C++ Header
Header file itself can be found here. It's C++ 17 and uses templating.
The definition seems pretty exotic so I suppose that something in it is unsupported.
Bindgen Invocation
Actual Results
The
bindings.rs
file has an undefined T value in IntArray:Which causes the expected compilation error:
For reference, here is the relevant header file.
Expected Results
I would expect the generated code to compile.
For now, I have found that simply replacing
T
byu64
(since it's the only type they used asT
in their code) works, but ideally I wouldn't have to edit the bindings by hand.Possibly related: #1464
Also see issue: #1490
The text was updated successfully, but these errors were encountered: