Skip to content

Commit 6dc4c98

Browse files
authored
Merge 2022-11 CWG Motion 2
P2709R0 Core Language Working Group "ready" issues for the November, 2022 meeting; issue 2635
2 parents 2764d46 + 194fdcd commit 6dc4c98

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

source/declarations.tex

+13-5
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,19 @@
172172
\pnum
173173
A \grammarterm{simple-declaration} with an \grammarterm{identifier-list} is called
174174
a \defn{structured binding declaration}\iref{dcl.struct.bind}.
175-
If the \grammarterm{decl-specifier-seq} contains
176-
any \grammarterm{decl-specifier} other than
177-
\keyword{static}, \keyword{thread_local}, \keyword{auto}\iref{dcl.spec.auto}, or
178-
\grammarterm{cv-qualifier}{s},
179-
the program is ill-formed.
175+
Each \grammarterm{decl-specifier} in the \grammarterm{decl-specifier-seq}
176+
shall be
177+
\tcode{static},
178+
\tcode{thread_local},
179+
\tcode{auto}\iref{dcl.spec.auto}, or
180+
a \grammarterm{cv-qualifier}.
181+
\begin{example}
182+
\begin{codeblock}
183+
template<class T> concept C = true;
184+
C auto [x, y] = std::pair{1, 2}; // error: constrained \grammarterm{placeholder-type-specifier}
185+
// not permitted for structured bindings
186+
\end{codeblock}
187+
\end{example}
180188
The \grammarterm{initializer} shall be
181189
of the form ``\tcode{=} \grammarterm{assignment-expression}'',
182190
of the form ``\tcode{\{} \grammarterm{assignment-expression} \tcode{\}}'',

0 commit comments

Comments
 (0)