Skip to content

Commit 8efdafb

Browse files
committed
Merge pull request #389 from cpplearner/patch-1
[diff.expr] Fix incorrect description of difference between C and C++: it is possible to declare, but (unlike C) not define, new types within expressions in C++.
2 parents c96c22a + f41da80 commit 8efdafb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/compatibility.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,16 @@
250250
Common.
251251

252252
\ref{expr.sizeof}, \ref{expr.cast}
253-
\change Types must be declared in declarations, not in expressions
254-
In C, a sizeof expression or cast expression may create a new type.
253+
\change Types must be defined in declarations, not in expressions\\
254+
In C, a sizeof expression or cast expression may define a new type.
255255
For example,
256256
\begin{codeblock}
257257
p = (void*)(struct x {int i;} *)0;
258258
\end{codeblock}
259-
declares a new type, struct x .
259+
defines a new type, struct \tcode{x} .
260260
\rationale
261261
This prohibition helps to clarify the location of
262-
declarations in the source code.
262+
definitions in the source code.
263263
\effect
264264
Deletion of a semantically well-defined feature.
265265
\difficulty

0 commit comments

Comments
 (0)