File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ impl Cursor {
131
131
/// Return the number of template arguments used by this cursor's referent,
132
132
/// if the referent is either a template specialization or
133
133
/// declaration. Returns -1 otherwise.
134
+ ///
135
+ /// NOTE: This may not return `Some` for some non-fully specialized
136
+ /// templates, see #193 and #194.
134
137
pub fn num_template_args ( & self ) -> Option < u32 > {
135
138
let n: c_int = unsafe { clang_Cursor_getNumTemplateArguments ( self . x ) } ;
136
139
@@ -193,7 +196,7 @@ impl Cursor {
193
196
/// Is the referent a fully specialized template specialization without any
194
197
/// remaining free template arguments?
195
198
pub fn is_fully_specialized_template ( & self ) -> bool {
196
- self . is_template ( ) && self . num_template_args ( ) . unwrap ( ) > 0
199
+ self . is_template ( ) && self . num_template_args ( ) . unwrap_or ( 0 ) > 0
197
200
}
198
201
199
202
/// Is the referent a template specialization that still has remaining free
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 ) ]
9
+ pub struct false_type {
10
+ pub _address : u8 ,
11
+ }
12
+ #[ test]
13
+ fn bindgen_test_layout_false_type ( ) {
14
+ assert_eq ! ( :: std:: mem:: size_of:: <false_type>( ) , 1usize ) ;
15
+ assert_eq ! ( :: std:: mem:: align_of:: <false_type>( ) , 1usize ) ;
16
+ }
17
+ impl Clone for false_type {
18
+ fn clone ( & self ) -> Self { * self }
19
+ }
Original file line number Diff line number Diff line change
1
+ // bindgen-flags: -- -std=c++11
2
+
3
+ struct false_type {};
4
+
5
+ template <typename _From, typename _To, bool >
6
+ struct __is_base_to_derived_ref ;
7
+
8
+ template <typename _From, typename _To>
9
+ struct __is_base_to_derived_ref <_From, _To, true >
10
+ {
11
+ typedef _To type;
12
+
13
+ static constexpr bool value = type::value;
14
+ };
15
+
16
+ template <typename _From, typename _To>
17
+ struct __is_base_to_derived_ref <_From, _To, false >
18
+ : public false_type
19
+ { };
You can’t perform that action at this time.
0 commit comments