diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 6c1ed02fbb..53ed24ff08 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -268,6 +268,7 @@ impl AppendImplicitTemplateParams for quote::Tokens { TypeKind::Void | TypeKind::NullPtr | TypeKind::Pointer(..) | + TypeKind::Reference(..) | TypeKind::Int(..) | TypeKind::Float(..) | TypeKind::Complex(..) | @@ -280,7 +281,6 @@ impl AppendImplicitTemplateParams for quote::Tokens { TypeKind::ObjCId | TypeKind::ObjCSel | TypeKind::TemplateInstantiation(..) => return, - _ => {}, } diff --git a/tests/expectations/tests/issue-1113-template-references.rs b/tests/expectations/tests/issue-1113-template-references.rs new file mode 100644 index 0000000000..3430f27dd7 --- /dev/null +++ b/tests/expectations/tests/issue-1113-template-references.rs @@ -0,0 +1,38 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Entry { + pub _base: K, + pub mData: V, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, +} +impl Default for Entry { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct nsBaseHashtable { + pub _address: u8, +} +pub type nsBaseHashtable_EntryType = Entry; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nsBaseHashtable_EntryPtr { + pub mEntry: *mut nsBaseHashtable_EntryType, + pub mExistingEntry: bool, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, +} +impl Default for nsBaseHashtable_EntryPtr { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} diff --git a/tests/headers/issue-1113-template-references.hpp b/tests/headers/issue-1113-template-references.hpp new file mode 100644 index 0000000000..46339c5dfe --- /dev/null +++ b/tests/headers/issue-1113-template-references.hpp @@ -0,0 +1,16 @@ +template +class Entry : public K +{ + V mData; +}; + +template +class nsBaseHashtable { + typedef Entry EntryType; + + struct EntryPtr { + private: + EntryType& mEntry; + bool mExistingEntry; + }; +};