mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Add examples to QLDoc comment
This commit is contained in:
@@ -843,16 +843,17 @@ class ArrayToPointerConversion extends Conversion, @array_to_pointer {
|
||||
/**
|
||||
* A node representing a temporary object created as part of an expression.
|
||||
*
|
||||
* This is most commonly seen in the following cases (from [class.temporary]/2):
|
||||
* - when binding a reference to a prvalue
|
||||
* - when performing member access on a class prvalue
|
||||
* - when performing an array-to-pointer conversion or subscripting on an array prvalue
|
||||
* - when initializing an object of type std::initializer_list from a braced-init-list
|
||||
* - for certain unevaluated operands
|
||||
* - when a prvalue that has type other than cv void appears as a discarded-value expression
|
||||
* This is most commonly seen in the following cases:
|
||||
* ```c++
|
||||
* // when binding a reference to a prvalue
|
||||
* const std::string& r = std::string("text");
|
||||
*
|
||||
* This node will only exist if the object is of class type, and even then only if either the
|
||||
* object's initialization or destruction is non-trivial.
|
||||
* // when performing member access on a class prvalue
|
||||
* strlen(std::string("text").c_str());
|
||||
*
|
||||
* // when a prvalue of a type with a destructor is discarded
|
||||
* s.substr(0, 5); // Return value is discarded but requires destruction
|
||||
* ```
|
||||
*/
|
||||
class TemporaryObjectExpr extends Conversion, @temp_init {
|
||||
/** Gets a textual representation of this conversion. */
|
||||
|
||||
Reference in New Issue
Block a user