Skip to content

Commit 694b7a7

Browse files
burblebeetkoeppe
authored andcommitted
CWG2876 Disambiguation of T x = delete("text")
Also fixes CWG2144.
1 parent a586edd commit 694b7a7

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

source/declarations.tex

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,29 @@
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
263-
\grammarterm{function-definition}. An object declaration, however, is also
264-
a definition unless it contains the \keyword{extern} specifier and has no
265-
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.
269+
\grammarterm{function-definition}.
270+
A token sequence starting with \tcode{\{} or \tcode{=}
271+
is treated as a \grammarterm{function-body}\iref{dcl.fct.def.general}
272+
if the type of the \grammarterm{declarator-id}\iref{dcl.meaning.general}
273+
is a function type, and
274+
is otherwise
275+
treated as a \grammarterm{brace-or-equal-initializer}\iref{dcl.init.general}.
276+
\begin{note}
277+
If the declaration acquires a function type through template instantiation,
278+
the program is ill-formed; see \ref{temp.spec.general}.
279+
The function type of a function definition
280+
cannot be specified with a \grammarterm{typedef-name}\iref{dcl.fct}.
281+
\end{note}
269282

270283
\pnum
271284
A \grammarterm{nodeclspec-function-declaration} shall declare a

0 commit comments

Comments
 (0)