Skip to content

Commit 56c9566

Browse files
committed
C++: more documentation for implict destructor calls
1 parent 3970a9f commit 56c9566

File tree

1 file changed

+12
-0
lines changed
  • cpp/ql/lib/semmle/code/cpp/stmts

1 file changed

+12
-0
lines changed

cpp/ql/lib/semmle/code/cpp/stmts/Stmt.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,23 @@ class Stmt extends StmtParent, @stmt {
6262
/**
6363
* Gets the `n`th compiler-generated destructor call that is performed after this statement, in
6464
* order of destruction.
65+
*
66+
* For instance, in the following code, `getImplicitDestructorCall(0)` for the block will be the
67+
* destructor call for `c2`:
68+
* ```cpp
69+
* {
70+
* MyClass c1;
71+
* MyClass c2;
72+
* }
73+
* ```
6574
*/
6675
DestructorCall getImplicitDestructorCall(int n) {
6776
synthetic_destructor_call(this, max(int i | synthetic_destructor_call(this, i, _)) - n, result)
6877
}
6978

79+
/**
80+
* Gets a compiler-generated destructor call that is performed after this statement.
81+
*/
7082
DestructorCall getAnImplicitDestructorCall() {
7183
synthetic_destructor_call(this, _, result)
7284
}

0 commit comments

Comments
 (0)