Skip to content

Commit 6f23aa0

Browse files
committed
CWG2876 Disambiguation of T x = delete("text")
Also fixes CWG2144.
1 parent 0882ce5 commit 6f23aa0

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

source/declarations.tex

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,31 @@
256256
\end{codeblock}
257257
\end{example}
258258

259+
\pnum
260+
\indextext{initialization!definition and}%
261+
An object definition causes
262+
storage of appropriate size and alignment to be reserved and
263+
any appropriate initialization\iref{dcl.init} to be done.
264+
259265
\pnum
260266
\indextext{definition!declaration as}%
261267
Syntactic components beyond those found in the general form of
262268
\grammarterm{simple-declaration} are added to a function declaration to make a
263269
\grammarterm{function-definition}. An object declaration, however, is also
264270
a definition unless it contains the \keyword{extern} specifier and has no
265271
initializer\iref{basic.def}.
266-
\indextext{initialization!definition and}%
267-
An object definition causes storage of appropriate size and alignment to be reserved and
268-
any appropriate initialization\iref{dcl.init} to be done.
272+
A token sequence starting with \tcode{\{} or \tcode{=}
273+
is treated as a \grammarterm{function-body}\iref{dcl.fct.def.general}
274+
if the type of the \grammarterm{declarator-id}\iref{dcl.meaning.general}
275+
is a function type, and
276+
is otherwise
277+
treated as a \grammarterm{brace-or-equal-initializer}\iref{dcl.init.general}.
278+
\begin{note}
279+
If the declaration acquires a function type through template instantiation,
280+
the program is ill-formed; see \ref{temp.spec.general}.
281+
The function type of a function definition
282+
cannot be specified with a \grammarterm{typedef-name}\iref{dcl.fct}.
283+
\end{note}
269284

270285
\pnum
271286
A \grammarterm{nodeclspec-function-declaration} shall declare a

0 commit comments

Comments
 (0)