Skip to content

Commit e40c51c

Browse files
committed
C++: Add documentation for TranslatedStructuredBindingVariableAccess
1 parent 0a4d813 commit e40c51c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,15 @@ class TranslatedFieldAccess extends TranslatedVariableAccess {
863863
}
864864
}
865865

866+
/**
867+
* The IR translation of a variable access of a structured binding, where the type
868+
* of the structured binding is not of a reference type, e.g., `x0` and `x1`
869+
* in `auto [x0, x1] = xs` where `xs` is an array. Although the type of the
870+
* structured binding is a non-reference type, the structured binding behaves
871+
* like a reference. Hence, the translation requires a `VariableAddress` followed
872+
* by a `Load` instead of only a `VariableAddress` as produced by
873+
* `TranslatedVariableAccess`.
874+
*/
866875
class TranslatedStructuredBindingVariableAccess extends TranslatedNonConstantExpr {
867876
override VariableAccess expr;
868877

0 commit comments

Comments
 (0)