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 @@ -4281,6 +4281,9 @@ impl CodeGenerator for Function {
4281
4281
if self . deleted_fn ( ) {
4282
4282
semantic_annotations. deleted_fn ( ) ;
4283
4283
}
4284
+ if self . defaulted_fn ( ) {
4285
+ semantic_annotations. defaulted_fn ( ) ;
4286
+ }
4284
4287
4285
4288
let link_name = mangled_name. unwrap_or ( name) ;
4286
4289
if !is_dynamic_function &&
Original file line number Diff line number Diff line change @@ -123,8 +123,11 @@ pub struct Function {
123
123
/// C++ visibility
124
124
visibility : Visibility ,
125
125
126
- /// Whether it's deleted (=default )
126
+ /// Whether it's deleted (=delete )
127
127
is_deleted : bool ,
128
+
129
+ /// Whether it's explicitly defaulted (=default)
130
+ is_defaulted : bool ,
128
131
}
129
132
130
133
impl Function {
@@ -139,6 +142,7 @@ impl Function {
139
142
special_member : Option < SpecialMemberKind > ,
140
143
visibility : Visibility ,
141
144
is_deleted : bool ,
145
+ is_defaulted : bool ,
142
146
) -> Self {
143
147
Function {
144
148
name,
@@ -150,6 +154,7 @@ impl Function {
150
154
special_member,
151
155
visibility,
152
156
is_deleted,
157
+ is_defaulted,
153
158
}
154
159
}
155
160
@@ -197,6 +202,11 @@ impl Function {
197
202
pub fn deleted_fn ( & self ) -> bool {
198
203
self . is_deleted
199
204
}
205
+
206
+ /// Whether this is a function that's been deleted (=delete)
207
+ pub fn defaulted_fn ( & self ) -> bool {
208
+ self . is_defaulted
209
+ }
200
210
}
201
211
202
212
impl DotAttributes for Function {
@@ -722,6 +732,7 @@ impl ClangSubItemParser for Function {
722
732
special_member,
723
733
visibility,
724
734
cursor. is_deleted_function ( ) ,
735
+ cursor. is_defaulted_function ( ) ,
725
736
) ;
726
737
Ok ( ParseResult :: New ( function, Some ( cursor) ) )
727
738
}
You can’t perform that action at this time.
0 commit comments