From 911c9220ef4e20f50173056d97c2f482bd300949 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:28:50 -0700 Subject: [PATCH 1/3] CWG2819 Cast from null pointer value in a constant expression --- source/expressions.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index cb20e88395..0ba2c3483d 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -7625,7 +7625,9 @@ from a prvalue \tcode{P} of type ``pointer to \cv{}~\keyword{void}'' to a type ``\cvqual{cv1} pointer to \tcode{T}'', where \tcode{T} is not \cvqual{cv2}~\keyword{void}, -unless \tcode{P} points to an object whose type is similar to \tcode{T}; +unless \tcode{P} +is a null pointer value or +points to an object whose type is similar to \tcode{T}; \item a \keyword{reinterpret_cast}\iref{expr.reinterpret.cast}; From a586edd27d3233ef6cddd3545805160da583ab2f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:44:30 -0700 Subject: [PATCH 2/3] CWG2858 Declarative nested-name-specifiers and pack-index-specifiers --- source/expressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 0ba2c3483d..33dd7edf88 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1661,7 +1661,7 @@ a declarative \grammarterm{nested-name-specifier}. \end{itemize} A declarative \grammarterm{nested-name-specifier} -shall not have a \grammarterm{decltype-specifier}. +shall not have a \grammarterm{computed-type-specifier}. A declaration that uses a declarative \grammarterm{nested-name-specifier} shall be a friend declaration or inhabit a scope that contains the entity being redeclared or specialized. From 694b7a7c20cb5a1200df5110515fe7aca1e40ec1 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:29:17 -0700 Subject: [PATCH 3/3] CWG2876 Disambiguation of T x = delete("text") Also fixes CWG2144. --- source/declarations.tex | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 0aeb59b809..1602d6ab3e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -256,16 +256,29 @@ \end{codeblock} \end{example} +\pnum +\indextext{initialization!definition and}% +An object definition causes +storage of appropriate size and alignment to be reserved and +any appropriate initialization\iref{dcl.init} to be done. + \pnum \indextext{definition!declaration as}% Syntactic components beyond those found in the general form of \grammarterm{simple-declaration} are added to a function declaration to make a -\grammarterm{function-definition}. An object declaration, however, is also -a definition unless it contains the \keyword{extern} specifier and has no -initializer\iref{basic.def}. -\indextext{initialization!definition and}% -An object definition causes storage of appropriate size and alignment to be reserved and -any appropriate initialization\iref{dcl.init} to be done. +\grammarterm{function-definition}. +A token sequence starting with \tcode{\{} or \tcode{=} +is treated as a \grammarterm{function-body}\iref{dcl.fct.def.general} +if the type of the \grammarterm{declarator-id}\iref{dcl.meaning.general} +is a function type, and +is otherwise +treated as a \grammarterm{brace-or-equal-initializer}\iref{dcl.init.general}. +\begin{note} +If the declaration acquires a function type through template instantiation, +the program is ill-formed; see \ref{temp.spec.general}. +The function type of a function definition +cannot be specified with a \grammarterm{typedef-name}\iref{dcl.fct}. +\end{note} \pnum A \grammarterm{nodeclspec-function-declaration} shall declare a