File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,10 @@ pub trait CppSemanticAttributeCreator {
166
166
self . add_ident ( "deleted" )
167
167
}
168
168
169
+ fn defaulted_fn ( & mut self ) {
170
+ self . add_ident ( "defaulted" )
171
+ }
172
+
169
173
fn layout ( & mut self , layout : & Layout ) {
170
174
let sz = ast_ty:: int_expr ( layout. size as i64 ) ;
171
175
let align = ast_ty:: int_expr ( layout. align as i64 ) ;
Original file line number Diff line number Diff line change @@ -4404,6 +4404,9 @@ impl CodeGenerator for Function {
4404
4404
if self . deleted_fn ( ) {
4405
4405
semantic_annotations. deleted_fn ( ) ;
4406
4406
}
4407
+ if self . defaulted_fn ( ) {
4408
+ semantic_annotations. defaulted_fn ( ) ;
4409
+ }
4407
4410
4408
4411
let link_name = mangled_name. unwrap_or ( name) ;
4409
4412
if !is_dynamic_function &&
Original file line number Diff line number Diff line change @@ -124,8 +124,11 @@ pub struct Function {
124
124
/// C++ visibility
125
125
visibility : Visibility ,
126
126
127
- /// Whether it's deleted (=default )
127
+ /// Whether it's deleted (=delete )
128
128
is_deleted : bool ,
129
+
130
+ /// Whether it's explicitly defaulted (=default)
131
+ is_defaulted : bool ,
129
132
}
130
133
131
134
impl Function {
@@ -140,6 +143,7 @@ impl Function {
140
143
special_member : Option < SpecialMemberKind > ,
141
144
visibility : Visibility ,
142
145
is_deleted : bool ,
146
+ is_defaulted : bool ,
143
147
) -> Self {
144
148
Function {
145
149
name,
@@ -151,6 +155,7 @@ impl Function {
151
155
special_member,
152
156
visibility,
153
157
is_deleted,
158
+ is_defaulted,
154
159
}
155
160
}
156
161
@@ -198,6 +203,11 @@ impl Function {
198
203
pub fn deleted_fn ( & self ) -> bool {
199
204
self . is_deleted
200
205
}
206
+
207
+ /// Whether this is a function that's been deleted (=delete)
208
+ pub fn defaulted_fn ( & self ) -> bool {
209
+ self . is_defaulted
210
+ }
201
211
}
202
212
203
213
impl DotAttributes for Function {
@@ -800,6 +810,7 @@ impl ClangSubItemParser for Function {
800
810
special_member,
801
811
visibility,
802
812
cursor. is_deleted_function ( ) ,
813
+ cursor. is_defaulted_function ( ) ,
803
814
) ;
804
815
Ok ( ParseResult :: New ( function, Some ( cursor) ) )
805
816
}
You can’t perform that action at this time.
0 commit comments