Skip to content

Commit d9bbb54

Browse files
authored
Merge 2025-06 CWG Motion 8
P1306R5 Expansion Statements
2 parents 6714f27 + 5391aa1 commit d9bbb54

File tree

5 files changed

+288
-75
lines changed

5 files changed

+288
-75
lines changed

source/basic.tex

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,9 @@
13291329
The locus of a \grammarterm{for-range-declaration}
13301330
of a range-based \keyword{for} statement\iref{stmt.ranged}
13311331
is immediately after the \grammarterm{for-range-initializer}.
1332+
The locus of a \grammarterm{for-range-declaration}
1333+
of an expansion statement\iref{stmt.expand}
1334+
is immediately after the \grammarterm{expansion-initializer}.
13321335

13331336
\pnum
13341337
The locus of a \grammarterm{template-parameter} is immediately after it.
@@ -1389,7 +1392,7 @@
13891392
Each
13901393
\begin{itemize}
13911394
\item
1392-
selection or iteration statement\iref{stmt.select,stmt.iter},
1395+
selection, iteration, or expansion statement\iref{stmt.select,stmt.iter,stmt.expand},
13931396
\item
13941397
substatement of such a statement,
13951398
\item
@@ -4763,7 +4766,7 @@
47634766
\pnum
47644767
\indextext{initializer!temporary and declarator}%
47654768
\indextext{temporary!order of destruction of}%
4766-
There are five contexts in which temporaries are destroyed at a different
4769+
There are several contexts in which temporaries are destroyed at a different
47674770
point than the end of the full-expression.
47684771
The first context is when a default constructor is called to initialize
47694772
an element of an array with no corresponding initializer\iref{dcl.init}.
@@ -4883,14 +4886,25 @@
48834886

48844887
\pnum
48854888
The fourth context is when a temporary object
4886-
is created in the \grammarterm{for-range-initializer} of a range-based \keyword{for} statement.
4889+
is created in the \grammarterm{for-range-initializer} of
4890+
either a range-based \keyword{for} statement
4891+
or an enumerating expansion statement\iref{stmt.expand}.
48874892
If such a temporary object would otherwise be destroyed
48884893
at the end of the \grammarterm{for-range-initializer} full-expression,
48894894
the object persists for the lifetime of the reference
48904895
initialized by the \grammarterm{for-range-initializer}.
48914896

48924897
\pnum
4893-
The fifth context is when a temporary object
4898+
The fifth context is when a temporary object is created
4899+
in the \grammarterm{expansion-initializer}
4900+
of an iterating or destructuring expansion statement.
4901+
If such a temporary object would otherwise be destroyed
4902+
at the end of that \grammarterm{expansion-initializer},
4903+
the object persists for the lifetime of the reference
4904+
initialized by the \grammarterm{expansion-initializer}, if any.
4905+
4906+
\pnum
4907+
The sixth context is when a temporary object
48944908
is created in a structured binding declaration\iref{dcl.struct.bind}.
48954909
Any temporary objects introduced by
48964910
the \grammarterm{initializer}{s} for the variables

source/declarations.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7678,7 +7678,8 @@
76787678
the program is ill-formed.
76797679

76807680
\pnum
7681-
If \tcode{E} is an array type with element type \tcode{T},
7681+
\tcode{E} shall not be an array type of unknown bound.
7682+
If \tcode{E} is any other array type with element type \tcode{T},
76827683
the structured binding size of \tcode{E} is equal to the
76837684
number of elements of \tcode{E}.
76847685
Each $\textrm{SB}_i$ is the name of an

source/preprocessor.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,7 @@
23382338
\defnxname{cpp_deleted_function} & \tcode{202403L} \\ \rowsep
23392339
\defnxname{cpp_designated_initializers} & \tcode{201707L} \\ \rowsep
23402340
\defnxname{cpp_enumerator_attributes} & \tcode{201411L} \\ \rowsep
2341+
\defnxname{cpp_expansion_statements} & \tcode{202506L} \\ \rowsep
23412342
\defnxname{cpp_explicit_this_parameter} & \tcode{202110L} \\ \rowsep
23422343
\defnxname{cpp_fold_expressions} & \tcode{201603L} \\ \rowsep
23432344
\defnxname{cpp_generic_lambdas} & \tcode{201707L} \\ \rowsep

0 commit comments

Comments
 (0)