Skip to content

Commit 8ccae3d

Browse files
committed
CWG3008 Missing Annex C entry for void object declarations
1 parent c68fc1a commit 8ccae3d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

source/compatibility.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,24 @@
31923192

31933193
\rSec2[diff.dcl]{\ref{dcl}: declarations}
31943194

3195+
\diffref{dcl.pre}
3196+
\change
3197+
In \Cpp{}, no declaration of a variable can have \cv{} \tcode{void} type.
3198+
In C, this is allowed, unless the declaration is a definition.
3199+
\begin{example}
3200+
\begin{codeblock}
3201+
extern void x; // valid C, invalid in \Cpp{}
3202+
\end{codeblock}
3203+
\end{example}
3204+
\rationale
3205+
Stricter type checking in \Cpp{}.
3206+
\effect
3207+
Deletion of semantically well-defined feature.
3208+
\difficulty
3209+
Syntactic transformation.
3210+
\howwide
3211+
Seldom.
3212+
31953213
\diffref{dcl.stc}
31963214
\change
31973215
In \Cpp{}, the \keyword{static} or \keyword{extern} specifiers can only be applied to names of objects or functions.\\

0 commit comments

Comments
 (0)