@@ -248,9 +248,19 @@ abstract class TranslatedStmt extends TranslatedElement, TTranslatedStmt {
248
248
final override TranslatedElement getChild ( int id ) {
249
249
result = this .getChildInternal ( id )
250
250
or
251
- exists ( int destructorIndex |
251
+ exists ( int destructorIndex , int tempDestructorCount |
252
252
result .( TranslatedExpr ) .getExpr ( ) = stmt .getImplicitDestructorCall ( destructorIndex ) and
253
- id = this .getFirstDestructorCallIndex ( ) + destructorIndex
253
+ id = this .getFirstDestructorCallIndex ( ) + destructorIndex - tempDestructorCount and
254
+ // suppress destructors of temporary variables until proper support is added for them.
255
+ tempDestructorCount =
256
+ count ( DestructorCall call , int tempIndex |
257
+ stmt .getImplicitDestructorCall ( tempIndex ) = call and
258
+ tempIndex < destructorIndex and
259
+ call .getQualifier ( ) instanceof ReuseExpr
260
+ |
261
+ call
262
+ ) and
263
+ not stmt .getImplicitDestructorCall ( destructorIndex ) .getQualifier ( ) instanceof ReuseExpr
254
264
)
255
265
}
256
266
@@ -261,7 +271,11 @@ abstract class TranslatedStmt extends TranslatedElement, TTranslatedStmt {
261
271
}
262
272
263
273
final override predicate hasAnImplicitDestructorCall ( ) {
264
- exists ( stmt .getAnImplicitDestructorCall ( ) )
274
+ exists ( stmt .getAnImplicitDestructorCall ( ) ) and
275
+ // suppress destructors of temporary variables until proper support is added for them.
276
+ exists ( Expr expr | stmt .getAnImplicitDestructorCall ( ) .getQualifier ( ) = expr |
277
+ not expr instanceof ReuseExpr
278
+ )
265
279
}
266
280
267
281
final override string toString ( ) { result = stmt .toString ( ) }
0 commit comments