rust-bindgen
rust-bindgen copied to clipboard
error[E0412]: cannot find type `_CharT` in this scope
This looks similar to #798, but I'm not sure if it is the same. I'm working on bindings for Octave and this comes up from the gcc headers related to std::string. https://github.com/ctaggart/octh/issues/8
Input C/C++ Header
template <typename, typename = int> class a;
template <typename _CharT> class b { _CharT c; };
template <typename _CharT, typename> class a : b<_CharT> { class B; };
template <typename _CharT, typename d> class a<_CharT, d>::B {
a<_CharT, d> e;
};
class octave_diary_stream : a<char> {};
Bindgen Invocation
#!/usr/bin/env bash
set -eu
clang-3.9 --std=c++11 -c __bindgen.ii
~/rust-bindgen/target/release/bindgen \
--output __bindgen.rs \
--enable-cxx-namespaces \
--whitelist-type octave.* \
--whitelist-function octave.* \
--use-core \
--raw-line "extern crate core;" \
__bindgen.ii \
-- -v -x c++ -std=c++11 \
2>/dev/null
rustc __bindgen.rs \
2>&1 \
| grep 'error\[E0412\]: cannot find type `_CharT` in this scope'
# time creduce ./bindgen-octh-8.sh __bindgen.ii
Actual Results
error[E0412]: cannot find type `_CharT` in this scope
Expected Results
No error. Either _CharT is defined or replaced.
Thanks for the bug report @ctaggart !
Also having on https://github.com/rust-lang/rust-bindgen/issues/2141