diff options
-rw-r--r-- | tests/expectations/tests/inner-typedef-gh422.rs | 37 | ||||
-rw-r--r-- | tests/headers/inner-typedef-gh422.hpp | 11 |
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/expectations/tests/inner-typedef-gh422.rs b/tests/expectations/tests/inner-typedef-gh422.rs new file mode 100644 index 00000000..1cfa549c --- /dev/null +++ b/tests/expectations/tests/inner-typedef-gh422.rs @@ -0,0 +1,37 @@ +#![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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Foo_InnerType<T> { + pub t: T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, +} +impl<T> Default for Foo_InnerType<T> { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type Bar = InnerType; +extern "C" { + #[link_name = "\u{1}_Z4funcv"] + pub fn func() -> Bar; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct InnerType { + pub _address: u8, +} diff --git a/tests/headers/inner-typedef-gh422.hpp b/tests/headers/inner-typedef-gh422.hpp new file mode 100644 index 00000000..301630a5 --- /dev/null +++ b/tests/headers/inner-typedef-gh422.hpp @@ -0,0 +1,11 @@ +template <typename T> +class Foo { +public: + class InnerType { + T t; + }; +}; + +typedef Foo<int>::InnerType Bar; + +Bar func();
\ No newline at end of file |