@@ -306,7 +306,14 @@ class ExprNode extends AstNode {
306
306
307
307
ExprNode ( ) { expr = ast }
308
308
309
- override AstNode getChildInternal ( int childIndex ) { result .getAst ( ) = expr .getChild ( childIndex ) }
309
+ override AstNode getChildInternal ( int childIndex ) {
310
+ result .getAst ( ) = expr .getChild ( childIndex )
311
+ or
312
+ exists ( int destructorIndex |
313
+ result .getAst ( ) = expr .getImplicitDestructorCall ( destructorIndex ) and
314
+ childIndex = destructorIndex + max ( int index | exists ( expr .getChild ( index ) ) or index = 0 ) + 1
315
+ )
316
+ }
310
317
311
318
override string getProperty ( string key ) {
312
319
result = super .getProperty ( key )
@@ -439,6 +446,11 @@ class StmtNode extends AstNode {
439
446
result .getAst ( ) = child .( Stmt )
440
447
)
441
448
)
449
+ or
450
+ exists ( int destructorIndex |
451
+ result .getAst ( ) = stmt .getImplicitDestructorCall ( destructorIndex ) and
452
+ childIndex = destructorIndex + max ( int index | exists ( stmt .getChild ( index ) ) or index = 0 ) + 1
453
+ )
442
454
}
443
455
444
456
override string getChildAccessorPredicateInternal ( int childIndex ) {
@@ -662,13 +674,22 @@ private string getChildAccessorWithoutConversions(Locatable parent, Element chil
662
674
or
663
675
not namedStmtChildPredicates ( s , child , _) and
664
676
exists ( int n | s .getChild ( n ) = child and result = "getChild(" + n + ")" )
677
+ or
678
+ exists ( int n |
679
+ s .getImplicitDestructorCall ( n ) = child and result = "getImplicitDestructorCall(" + n + ")"
680
+ )
665
681
)
666
682
or
667
683
exists ( Expr expr | expr = parent |
668
684
namedExprChildPredicates ( expr , child , result )
669
685
or
670
686
not namedExprChildPredicates ( expr , child , _) and
671
687
exists ( int n | expr .getChild ( n ) = child and result = "getChild(" + n + ")" )
688
+ or
689
+ exists ( int n |
690
+ expr .getImplicitDestructorCall ( n ) = child and
691
+ result = "getImplicitDestructorCall(" + n + ")"
692
+ )
672
693
)
673
694
)
674
695
}
0 commit comments