Skip to content

Commit 52d5e3b

Browse files
authored
Merge 2024-06 CWG Motion 2
P3345R0 Core Language Working Group "ready" Issues, issues 2819, 2858, and 2876 (and subsuming 2144)
2 parents 37303be + 694b7a7 commit 52d5e3b

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
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

source/expressions.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@
16611661
a declarative \grammarterm{nested-name-specifier}.
16621662
\end{itemize}
16631663
A declarative \grammarterm{nested-name-specifier}
1664-
shall not have a \grammarterm{decltype-specifier}.
1664+
shall not have a \grammarterm{computed-type-specifier}.
16651665
A declaration that uses a declarative \grammarterm{nested-name-specifier}
16661666
shall be a friend declaration or
16671667
inhabit a scope that contains the entity being redeclared or specialized.
@@ -7625,7 +7625,9 @@
76257625
from a prvalue \tcode{P} of type ``pointer to \cv{}~\keyword{void}''
76267626
to a type ``\cvqual{cv1} pointer to \tcode{T}'',
76277627
where \tcode{T} is not \cvqual{cv2}~\keyword{void},
7628-
unless \tcode{P} points to an object whose type is similar to \tcode{T};
7628+
unless \tcode{P}
7629+
is a null pointer value or
7630+
points to an object whose type is similar to \tcode{T};
76297631

76307632
\item
76317633
a \keyword{reinterpret_cast}\iref{expr.reinterpret.cast};

0 commit comments

Comments
 (0)