Auto merge of #1444 - scoopr:fix_noisy, r=emilio
Fix noisy errors
This silences errors from template functions and dependant types.
diff --git a/src/ir/item.rs b/src/ir/item.rs
index a6ee4ff..380313e 100644
--- a/src/ir/item.rs
+++ b/src/ir/item.rs
@@ -1319,7 +1319,8 @@
CXCursor_UsingDeclaration |
CXCursor_UsingDirective |
CXCursor_StaticAssert |
- CXCursor_InclusionDirective => {
+ CXCursor_InclusionDirective |
+ CXCursor_FunctionTemplate => {
debug!(
"Unhandled cursor kind {:?}: {:?}",
cursor.kind(),
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index 75d5960..922146e 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -1184,6 +1184,9 @@
name = interface.rust_name();
TypeKind::ObjCInterface(interface)
}
+ CXType_Dependent => {
+ return Err(ParseError::Continue);
+ }
_ => {
error!(
"unsupported type: kind = {:?}; ty = {:?}; at {:?}",
diff --git a/tests/expectations/tests/enum_in_template.rs b/tests/expectations/tests/enum_in_template.rs
new file mode 100644
index 0000000..24be7a7
--- /dev/null
+++ b/tests/expectations/tests/enum_in_template.rs
@@ -0,0 +1,17 @@
+/* automatically generated by rust-bindgen */
+
+#![allow(
+ dead_code,
+ non_snake_case,
+ non_camel_case_types,
+ non_upper_case_globals
+)]
+
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Foo {
+ pub _address: u8,
+}
+pub const Foo_Bar_A: Foo_Bar = 0;
+pub const Foo_Bar_B: Foo_Bar = 0;
+pub type Foo_Bar = i32;
diff --git a/tests/expectations/tests/template_fun.rs b/tests/expectations/tests/template_fun.rs
new file mode 100644
index 0000000..d677679
--- /dev/null
+++ b/tests/expectations/tests/template_fun.rs
@@ -0,0 +1,8 @@
+/* automatically generated by rust-bindgen */
+
+#![allow(
+ dead_code,
+ non_snake_case,
+ non_camel_case_types,
+ non_upper_case_globals
+)]
diff --git a/tests/headers/enum_in_template.hpp b/tests/headers/enum_in_template.hpp
new file mode 100644
index 0000000..41c017c
--- /dev/null
+++ b/tests/headers/enum_in_template.hpp
@@ -0,0 +1,10 @@
+
+template <class T>
+class Foo
+{
+ enum Bar
+ {
+ A,
+ B
+ };
+};
diff --git a/tests/headers/template_fun.hpp b/tests/headers/template_fun.hpp
new file mode 100644
index 0000000..17b1383
--- /dev/null
+++ b/tests/headers/template_fun.hpp
@@ -0,0 +1,3 @@
+// this will be ignored
+template <class T>
+void foo() {}