Skip to content

Commit a4994b4

Browse files
jensmaurertkoeppe
authored andcommitted
[diff] Annotate keywords
1 parent ba9124e commit a4994b4

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

source/compatibility.tex

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,7 @@
21162116

21172117
\diffref{conv.ptr}
21182118
\change
2119-
Converting \tcode{void*} to a pointer-to-object type requires casting.
2119+
Converting \tcode{\keyword{void}*} to a pointer-to-object type requires casting.
21202120

21212121
\begin{codeblock}
21222122
char a[10];
@@ -2166,19 +2166,19 @@
21662166

21672167
\diffref{expr.post.incr,expr.pre.incr}
21682168
\change
2169-
Decrement operator is not allowed with \tcode{bool} operand.
2169+
Decrement operator is not allowed with \keyword{bool} operand.
21702170
\rationale
21712171
Feature with surprising semantics.
21722172
\effect
21732173
A valid ISO C expression utilizing the decrement operator on
2174-
a \tcode{bool} lvalue
2174+
a \keyword{bool} lvalue
21752175
(for instance, via the C typedef in \libheaderref{stdbool.h})
21762176
is ill-formed in \Cpp{}.
21772177

21782178
\diffref{expr.sizeof,expr.cast}
21792179
\change
21802180
In \Cpp{}, types can only be defined in declarations, not in expressions.\\
2181-
In C, a sizeof expression or cast expression may define a new type.
2181+
In C, a \keyword{sizeof} expression or cast expression may define a new type.
21822182
For example,
21832183
\begin{codeblock}
21842184
p = (void*)(struct x {int i;} *)0;
@@ -2570,7 +2570,7 @@
25702570

25712571
\diffref{dcl.enum}
25722572
\change
2573-
In \Cpp{}, the type of an enumerator is its enumeration. In C, the type of an enumerator is \tcode{int}.
2573+
In \Cpp{}, the type of an enumerator is its enumeration. In C, the type of an enumerator is \keyword{int}.
25742574

25752575
Example:
25762576
\begin{codeblock}
@@ -2653,7 +2653,7 @@
26532653
\rationale
26542654
Several alternatives were debated at length.
26552655
Changing the parameter to
2656-
\tcode{volatile}
2656+
\keyword{volatile}
26572657
\keyword{const}
26582658
\tcode{X\&}
26592659
would greatly complicate the generation of
@@ -2683,7 +2683,7 @@
26832683
\diffref{class.bit}
26842684
\change
26852685
\indextext{bit-field!implementation-defined sign of}%
2686-
Bit-fields of type plain \tcode{int} are signed.
2686+
Bit-fields of type plain \keyword{int} are signed.
26872687
\rationale
26882688
Leaving the choice of signedness to implementations could lead to
26892689
inconsistent definitions of template specializations. For consistency,
@@ -2849,18 +2849,18 @@
28492849

28502850
\pnum
28512851
The tokens
2852-
\tcode{and},
2853-
\tcode{and_eq},
2854-
\tcode{bitand},
2855-
\tcode{bitor},
2856-
\tcode{compl},
2857-
\tcode{not},
2858-
\tcode{not_eq},
2859-
\tcode{or},
2860-
\tcode{or_eq},
2861-
\tcode{xor},
2852+
\keyword{and},
2853+
\keyword{and_eq},
2854+
\keyword{bitand},
2855+
\keyword{bitor},
2856+
\keyword{compl},
2857+
\keyword{not},
2858+
\keyword{not_eq},
2859+
\keyword{or},
2860+
\keyword{or_eq},
2861+
\keyword{xor},
28622862
and
2863-
\tcode{xor_eq}
2863+
\keyword{xor_eq}
28642864
are keywords in \Cpp{}\iref{lex.key},
28652865
and are not introduced as macros
28662866
by \libheaderref{iso646.h}.
@@ -2869,15 +2869,15 @@
28692869
\indexhdr{stdalign.h}%
28702870

28712871
\pnum
2872-
The token \tcode{alignas} is a keyword in \Cpp{}\iref{lex.key},
2872+
The token \keyword{alignas} is a keyword in \Cpp{}\iref{lex.key},
28732873
and is not introduced as a macro
28742874
by \libheaderref{stdalign.h}.
28752875

28762876
\rSec3[diff.header.stdbool.h]{Header \tcode{<stdbool.h>}}
28772877
\indexhdr{stdbool.h}%
28782878

28792879
\pnum
2880-
The tokens \tcode{bool}, \tcode{true}, and \tcode{false}
2880+
The tokens \keyword{bool}, \keyword{true}, and \keyword{false}
28812881
are keywords in \Cpp{}\iref{lex.key},
28822882
and are not introduced as macros
28832883
by \libheaderref{stdbool.h}.

0 commit comments

Comments
 (0)