From b83da2729fc83663f979da05201920e039ae3c3f Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Sun, 22 Jan 2017 12:58:12 +0100 Subject: Unify under the `bindgen` name. --- tests/headers/template.hpp | 144 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 tests/headers/template.hpp (limited to 'tests/headers/template.hpp') diff --git a/tests/headers/template.hpp b/tests/headers/template.hpp new file mode 100644 index 00000000..c13643c3 --- /dev/null +++ b/tests/headers/template.hpp @@ -0,0 +1,144 @@ +template class Foo { + T m_member; + T* m_member_ptr; + T m_member_arr[1]; +}; + +void bar(Foo foo); + +template +class D { + typedef Foo MyFoo; + + MyFoo m_foo; + + template + class U { + MyFoo m_nested_foo; + Z m_baz; + }; +}; + +template +class Rooted { + T* prev; + Rooted* next; + T ptr; +}; + +class RootedContainer { + Rooted root; +}; + +template +class WithDtor; + +typedef WithDtor WithDtorIntFwd; + +template +class WithDtor { + T member; + ~WithDtor() {} +}; + +class PODButContainsDtor { + WithDtorIntFwd member; +}; + + +/**
*/ +template +class Opaque { + T member; +}; + +class POD { + Opaque opaque_member; +}; + +/** + *
+ */ +template +class Nested { + T* buff; +}; + +template +class NestedBase { + T* buff; +}; + +template +class NestedReplaced: public NestedBase { +}; + +template +class Incomplete; + +template +class NestedContainer { + T c; +private: + NestedReplaced nested; + Incomplete inc; +}; + +template +class Incomplete { + T d; +}; + +class Untemplated {}; + +template +class Templated { + Untemplated m_untemplated; +}; + +/** + * If the replacement doesn't happen at the parse level the container would be + * copy and the replacement wouldn't, so this wouldn't compile. + * + *
+ */ +template +class ReplacedWithDestructor { + T* buff; + ~ReplacedWithDestructor() {}; +}; + +template +class ReplacedWithoutDestructor { + T* buff; +}; + +template +class ReplacedWithoutDestructorFwd; + +template +class ShouldNotBeCopiable { + ReplacedWithoutDestructor m_member; +}; + +template +class ShouldNotBeCopiableAsWell { + ReplacedWithoutDestructorFwd m_member; +}; + +/** + * If the replacement doesn't happen at the parse level the container would be + * copy and the replacement wouldn't, so this wouldn't compile. + * + *
+ */ +template +class ReplacedWithDestructorDeclaredAfter { + T* buff; + ~ReplacedWithDestructorDeclaredAfter() {}; +}; + +template +class TemplateWithVar { + static T var = 0; +}; -- cgit v1.2.3