File tree 3 files changed +62
-1
lines changed 3 files changed +62
-1
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,13 @@ impl FunctionSig {
186
186
} ;
187
187
188
188
let is_method = cursor. kind ( ) == CXCursor_CXXMethod ;
189
+ let is_constructor = cursor. kind ( ) == CXCursor_Constructor ;
190
+ if is_constructor && cursor. lexical_parent ( ) != cursor. semantic_parent ( ) {
191
+ // Only parse constructors once.
192
+ return Err ( ParseError :: Continue ) ;
193
+ }
189
194
190
- if is_method || cursor . kind ( ) == CXCursor_Constructor {
195
+ if is_method || is_constructor {
191
196
let is_const = is_method && cursor. method_is_const ( ) ;
192
197
let is_virtual = is_method && cursor. method_is_virtual ( ) ;
193
198
let is_static = is_method && cursor. method_is_static ( ) ;
Original file line number Diff line number Diff line change
1
+ /* automatically generated by rust-bindgen */
2
+
3
+
4
+ #![ allow( non_snake_case) ]
5
+
6
+
7
+ #[ repr( C ) ]
8
+ #[ derive( Debug , Copy , Clone ) ]
9
+ pub struct Foo < T > {
10
+ pub _address : u8 ,
11
+ pub _phantom_0 : :: std:: marker:: PhantomData < T > ,
12
+ }
13
+ #[ repr( C ) ]
14
+ #[ derive( Debug , Copy ) ]
15
+ pub struct Bar {
16
+ pub _address : u8 ,
17
+ }
18
+ #[ test]
19
+ fn bindgen_test_layout_Bar ( ) {
20
+ assert_eq ! ( :: std:: mem:: size_of:: <Bar >( ) , 1usize ) ;
21
+ assert_eq ! ( :: std:: mem:: align_of:: <Bar >( ) , 1usize ) ;
22
+ }
23
+ extern "C" {
24
+ #[ link_name = "_ZN3BarC1Ev" ]
25
+ pub fn Bar_Bar ( this : * mut Bar ) ;
26
+ }
27
+ impl Clone for Bar {
28
+ fn clone ( & self ) -> Self { * self }
29
+ }
30
+ impl Bar {
31
+ #[ inline]
32
+ pub unsafe fn new ( ) -> Self {
33
+ let mut __bindgen_tmp = :: std:: mem:: uninitialized ( ) ;
34
+ Bar_Bar ( & mut __bindgen_tmp) ;
35
+ __bindgen_tmp
36
+ }
37
+ }
Original file line number Diff line number Diff line change
1
+
2
+ template <typename T>
3
+ class Foo {
4
+ public:
5
+ Foo ();
6
+ };
7
+
8
+ class Bar {
9
+ public:
10
+ Bar ();
11
+ };
12
+
13
+ template <typename T>
14
+ Foo<T>::Foo() {
15
+ }
16
+
17
+ inline
18
+ Bar::Bar () {
19
+ }
You can’t perform that action at this time.
0 commit comments