File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/exprs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -843,16 +843,17 @@ class ArrayToPointerConversion extends Conversion, @array_to_pointer {
843843/**
844844 * A node representing a temporary object created as part of an expression.
845845 *
846- * This is most commonly seen in the following cases (from [class.temporary]/2):
847- * - when binding a reference to a prvalue
848- * - when performing member access on a class prvalue
849- * - when performing an array-to-pointer conversion or subscripting on an array prvalue
850- * - when initializing an object of type std::initializer_list from a braced-init-list
851- * - for certain unevaluated operands
852- * - when a prvalue that has type other than cv void appears as a discarded-value expression
853- *
854- * This node will only exist if the object is of class type, and even then only if either the
855- * object's initialization or destruction is non-trivial.
846+ * This is most commonly seen in the following cases:
847+ * ```c++
848+ * // when binding a reference to a prvalue
849+ * const std::string& r = std::string("text");
850+ *
851+ * // when performing member access on a class prvalue
852+ * strlen(std::string("text").c_str());
853+ *
854+ * // when a prvalue of a type with a destructor is discarded
855+ * s.substr(0, 5); // Return value is discarded but requires destruction
856+ * ```
856857 */
857858class TemporaryObjectExpr extends Conversion , @temp_init {
858859 /** Gets a textual representation of this conversion. */
You can’t perform that action at this time.
0 commit comments