diff options
-rw-r--r-- | src/ir/item.rs | 3 | ||||
-rw-r--r-- | src/ir/ty.rs | 3 | ||||
-rw-r--r-- | tests/expectations/tests/enum_in_template.rs | 17 | ||||
-rw-r--r-- | tests/expectations/tests/template_fun.rs | 8 | ||||
-rw-r--r-- | tests/headers/enum_in_template.hpp | 10 | ||||
-rw-r--r-- | tests/headers/template_fun.hpp | 3 |
6 files changed, 43 insertions, 1 deletions
diff --git a/src/ir/item.rs b/src/ir/item.rs index a6ee4ff3..380313e7 100644 --- a/src/ir/item.rs +++ b/src/ir/item.rs @@ -1319,7 +1319,8 @@ impl ClangItemParser for Item { 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 75d5960d..922146ea 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs @@ -1184,6 +1184,9 @@ impl Type { 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 00000000..24be7a71 --- /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 00000000..d6776794 --- /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 00000000..41c017c4 --- /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 00000000..17b1383b --- /dev/null +++ b/tests/headers/template_fun.hpp @@ -0,0 +1,3 @@ +// this will be ignored +template <class T> +void foo() {} |