|
1281 | 1281 | The locus of a \grammarterm{for-range-declaration}
|
1282 | 1282 | of a range-based \keyword{for} statement\iref{stmt.ranged}
|
1283 | 1283 | is immediately after the \grammarterm{for-range-initializer}.
|
| 1284 | +The locus of a \grammarterm{for-range-declaration} |
| 1285 | +of an expansion statement\iref{stmt.expand} |
| 1286 | +is immediately after the \grammarterm{expansion-initializer}. |
1284 | 1287 |
|
1285 | 1288 | \pnum
|
1286 | 1289 | The locus of a \grammarterm{template-parameter} is immediately after it.
|
|
1341 | 1344 | Each
|
1342 | 1345 | \begin{itemize}
|
1343 | 1346 | \item
|
1344 |
| -selection or iteration statement\iref{stmt.select,stmt.iter}, |
| 1347 | +selection, iteration, or expansion statement\iref{stmt.select,stmt.iter,stmt.expand}, |
1345 | 1348 | \item
|
1346 | 1349 | substatement of such a statement,
|
1347 | 1350 | \item
|
|
4591 | 4594 | \pnum
|
4592 | 4595 | \indextext{initializer!temporary and declarator}%
|
4593 | 4596 | \indextext{temporary!order of destruction of}%
|
4594 |
| -There are five contexts in which temporaries are destroyed at a different |
| 4597 | +There are several contexts in which temporaries are destroyed at a different |
4595 | 4598 | point than the end of the full-expression.
|
4596 | 4599 | The first context is when a default constructor is called to initialize
|
4597 | 4600 | an element of an array with no corresponding initializer\iref{dcl.init}.
|
|
4711 | 4714 |
|
4712 | 4715 | \pnum
|
4713 | 4716 | The fourth context is when a temporary object
|
4714 |
| -is created in the \grammarterm{for-range-initializer} of a range-based \keyword{for} statement. |
| 4717 | +is created in the \grammarterm{for-range-initializer} of |
| 4718 | +either a range-based \keyword{for} statement |
| 4719 | +or an enumerating expansion statement\iref{stmt.expand}. |
4715 | 4720 | If such a temporary object would otherwise be destroyed
|
4716 | 4721 | at the end of the \grammarterm{for-range-initializer} full-expression,
|
4717 | 4722 | the object persists for the lifetime of the reference
|
4718 | 4723 | initialized by the \grammarterm{for-range-initializer}.
|
4719 | 4724 |
|
4720 | 4725 | \pnum
|
4721 |
| -The fifth context is when a temporary object |
| 4726 | +The fifth context is when a temporary object is created |
| 4727 | +in the \grammarterm{expansion-initializer} |
| 4728 | +of an iterating or destructuring expansion statement. |
| 4729 | +If such a temporary object would otherwise be destroyed |
| 4730 | +at the end of that \grammarterm{expansion-initializer}, |
| 4731 | +the object persists for the lifetime of the reference |
| 4732 | +initialized by the \grammarterm{expansion-initializer}, if any. |
| 4733 | + |
| 4734 | +\pnum |
| 4735 | +The sixth context is when a temporary object |
4722 | 4736 | is created in a structured binding declaration\iref{dcl.struct.bind}.
|
4723 | 4737 | Any temporary objects introduced by
|
4724 | 4738 | the \grammarterm{initializer}{s} for the variables
|
|
0 commit comments