blob: bc32a357e87916aaedb104b07cd93e4faa78d7f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++11
//
template<typename T, typename U> class Foo {
T m_member;
T* m_member_ptr;
T m_member_arr[1];
};
template<typename T> class B {
T m_member { 0 };
};
void bar(Foo<int, int> foo);
namespace mozilla {
class Foo;
};
struct C {
B<unsigned int> mB;
B<const int*> mBConstPtr;
B<const mozilla::Foo*> mBConstStructPtr;
B<const mozilla::Foo*[1]> mBConstStructPtrArray;
B<const int> mBConst;
B<volatile int> mBVolatile;
B<const bool> mBConstBool;
B<const char16_t> mBConstChar;
B<int[1]> mBArray;
B<int*[1]> mBPtrArray;
B<int(*)[1]> mBArrayPtr;
B<int&> mBRef;
B<const int&> mBConstRef;
B<int*&> mPtrRef;
B<int(&)[1]> mArrayRef;
B<const int[1]> mBConstArray;
};
template<typename T>
class D {
typedef Foo<int, int> MyFoo;
MyFoo m_foo;
template<typename Z>
class U {
MyFoo m_nested_foo;
Z m_baz;
};
};
template<typename T>
class Rooted {
T* prev;
Rooted<void*>* next;
T ptr;
};
class RootedContainer {
Rooted<void*> root;
};
template<typename T>
class WithDtor;
typedef WithDtor<int> WithDtorIntFwd;
template<typename T>
class WithDtor {
T member;
~WithDtor() {}
};
class PODButContainsDtor {
WithDtorIntFwd member;
};
/** <div rustbindgen opaque> */
template<typename T>
class Opaque {
T member;
};
class POD {
Opaque<int> opaque_member;
};
/**
* <div rustbindgen replaces="NestedReplaced"></div>
*/
template<typename T>
class Nested {
T* buff;
};
template<typename T, typename U>
class NestedBase {
T* buff;
};
template<typename T>
class NestedReplaced: public NestedBase<T, int> {
};
template<typename T>
class Incomplete;
template<typename T>
class NestedContainer {
T c;
private:
NestedReplaced<T> nested;
Incomplete<T> inc;
};
template<typename T>
class Incomplete {
T d;
};
class Untemplated {};
template<typename T>
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.
*
* <div rustbindgen replaces="ReplacedWithoutDestructor"></div>
*/
template<typename T>
class ReplacedWithDestructor {
T* buff;
~ReplacedWithDestructor() {};
};
template<typename T>
class ReplacedWithoutDestructor {
T* buff;
};
template<typename T>
class ReplacedWithoutDestructorFwd;
template<typename T>
class ShouldNotBeCopiable {
ReplacedWithoutDestructor<T> m_member;
};
template<typename U>
class ShouldNotBeCopiableAsWell {
ReplacedWithoutDestructorFwd<U> 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.
*
* <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div>
*/
template<typename T>
class ReplacedWithDestructorDeclaredAfter {
T* buff;
~ReplacedWithDestructorDeclaredAfter() {};
};
|