Skip to content

Commit dee5142

Browse files
committed
C++: Add a high-level description of the forwarding model.
1 parent f00b553 commit dee5142

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@
110110
* - "manual": The model has been written by hand.
111111
* This information is used in a heuristic for dataflow analysis to determine, if a
112112
* model or source code should be used for determining flow.
113+
*
114+
* The "Forwards" relation allows modeling of function that perform C++11-style "perfect
115+
* forwarding" where a function receives a number of arguments and forwards those arguments
116+
* to a constructor of another type. For example, the row:
117+
* `"std"; "vector<T>"; "True"; "emplace"; ""; ""; "1"; T; Argument[-1].Element; manual`
118+
* says that `std::vector<T>::emplace(arg0, arg1, ..., argn)` forwards arguments
119+
* `arg1, ..., argn` to a constructor for `T`, and the result of `T(arg1, ..., argn)`
120+
* flows to `Argument[-1].Element` (see information about the semantics of the `output`
121+
* column further above).
113122
*/
114123

115124
import cpp

0 commit comments

Comments
 (0)