@@ -248,9 +248,19 @@ abstract class TranslatedStmt extends TranslatedElement, TTranslatedStmt {
248248 final override TranslatedElement getChild ( int id ) {
249249 result = this .getChildInternal ( id )
250250 or
251- exists ( int destructorIndex |
251+ exists ( int destructorIndex , int tempDestructorCount |
252252 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
254264 )
255265 }
256266
@@ -261,7 +271,11 @@ abstract class TranslatedStmt extends TranslatedElement, TTranslatedStmt {
261271 }
262272
263273 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+ )
265279 }
266280
267281 final override string toString ( ) { result = stmt .toString ( ) }
0 commit comments