Skip to content

Commit 89ad8fa

Browse files
jensmaurertkoeppe
authored andcommitted
Replace \nonterminal with \grammarterm or \cvqual, as appropriate. (#1316)
Fixes #1312.
1 parent 6f5c004 commit 89ad8fa

File tree

8 files changed

+60
-62
lines changed

8 files changed

+60
-62
lines changed

source/classes.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609

610610
\pnum
611611
A member shall not be declared with the \tcode{extern}
612-
\nonterminal{storage-class-specifier}. Within a class definition, a member shall not be declared with the \tcode{thread_local} \nonterminal{storage-class-specifier} unless also declared \tcode{static}.
612+
\grammarterm{storage-class-specifier}. Within a class definition, a member shall not be declared with the \tcode{thread_local} \grammarterm{storage-class-specifier} unless also declared \tcode{static}.
613613

614614
\pnum
615615
The \grammarterm{decl-specifier-seq} may be omitted in constructor, destructor,

source/declarations.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@
401401
see~\ref{basic.link}.
402402
\begin{note}
403403
The \tcode{extern} keyword can also be used in
404-
\nonterminal{explicit-instantiation}s and
405-
\nonterminal{linkage-specification}s, but it is not a
406-
\nonterminal{storage-class-specifier} in such contexts.
404+
\grammarterm{explicit-instantiation}s and
405+
\grammarterm{linkage-specification}s, but it is not a
406+
\grammarterm{storage-class-specifier} in such contexts.
407407
\end{note}
408408

409409
\pnum
@@ -1589,7 +1589,7 @@
15891589
deduced from its initializer. This use is allowed when declaring variables in a
15901590
block~(\ref{stmt.block}), in
15911591
namespace scope~(\ref{basic.scope.namespace}), and in an
1592-
\nonterminal{init-statement} (Clause~\ref{stmt.stmt}).
1592+
\grammarterm{init-statement} (Clause~\ref{stmt.stmt}).
15931593
\tcode{auto} or \tcode{decltype(auto)} shall appear as one of the
15941594
\grammarterm{decl-specifier}{s} in the
15951595
\grammarterm{decl-specifier-seq} and the
@@ -1618,14 +1618,14 @@
16181618

16191619
\pnum
16201620
A placeholder type can also be used in declaring a variable in
1621-
the \nonterminal{condition} of a selection statement~(\ref{stmt.select}) or an iteration
1622-
statement~(\ref{stmt.iter}), in the \nonterminal{type-specifier-seq} in
1623-
the \nonterminal{new-type-id} or \nonterminal{type-id} of a
1624-
\nonterminal{new-expression}~(\ref{expr.new}), in a
1621+
the \grammarterm{condition} of a selection statement~(\ref{stmt.select}) or an iteration
1622+
statement~(\ref{stmt.iter}), in the \grammarterm{type-specifier-seq} in
1623+
the \grammarterm{new-type-id} or \grammarterm{type-id} of a
1624+
\grammarterm{new-expression}~(\ref{expr.new}), in a
16251625
\grammarterm{for-range-declaration},
16261626
in declaring a static data member with a
16271627
\grammarterm{brace-or-equal-initializer} that appears within the
1628-
\nonterminal{member-specification} of a class definition~(\ref{class.static.data}),
1628+
\grammarterm{member-specification} of a class definition~(\ref{class.static.data}),
16291629
and as a \grammarterm{decl-specifier}
16301630
of the \grammarterm{parameter-declaration}{'s}
16311631
\grammarterm{decl-specifier-seq}

source/declarators.tex

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@
956956
then the type of the identifier of
957957
\tcode{D}
958958
is an array type; if the type of the identifier of \tcode{D}
959-
contains the \tcode{auto} \nonterminal{type-specifier},
959+
contains the \tcode{auto} \grammarterm{type-specifier},
960960
the program is ill-formed.
961961
\tcode{T}
962962
is called the array
@@ -1005,13 +1005,13 @@
10051005
\tcode{T}'',
10061006
see~\ref{basic.types}.
10071007
Any type of the form
1008-
``\nonterminal{cv-qualifier-seq} array of
1008+
``\grammarterm{cv-qualifier-seq} array of
10091009
\tcode{N}
10101010
\tcode{T}''
10111011
is adjusted to
10121012
``array of
10131013
\tcode{N}
1014-
\nonterminal{cv-qualifier-seq}
1014+
\grammarterm{cv-qualifier-seq}
10151015
\tcode{T}'',
10161016
and similarly for
10171017
``array of unknown bound of
@@ -1029,7 +1029,7 @@
10291029
An
10301030
``array of
10311031
\tcode{N}
1032-
\nonterminal{cv-qualifier-seq}
1032+
\grammarterm{cv-qualifier-seq}
10331033
\tcode{T}''
10341034
has cv-qualified type; see~\ref{basic.type.qualifier}.
10351035
\end{note}
@@ -2858,13 +2858,13 @@
28582858
\indextext{initialization!\idxcode{const}}%
28592859
\begin{note}
28602860
An expression of type
2861-
``\nonterminal{cv1} \tcode{T}''
2861+
``\cvqual{cv1} \tcode{T}''
28622862
can initialize an object of type
2863-
``\nonterminal{cv2} \tcode{T}''
2863+
``\cvqual{cv2} \tcode{T}''
28642864
independently of
28652865
the cv-qualifiers
2866-
\nonterminal{cv1}
2867-
and \nonterminal{cv2}.
2866+
\cvqual{cv1}
2867+
and \cvqual{cv2}.
28682868

28692869
\begin{codeblock}
28702870
int a;
@@ -3455,15 +3455,13 @@
34553455
\end{example}
34563456

34573457
\pnum
3458-
Given types ``\nonterminal{cv1} \tcode{T1}'' and ``\nonterminal{cv2} \tcode{T2}'',
3459-
``\nonterminal{cv1} \tcode{T1}'' is \nonterminal{reference-related} to
3460-
\indextext{reference-related}%
3461-
``\nonterminal{cv2} \tcode{T2}'' if
3458+
Given types ``\cvqual{cv1} \tcode{T1}'' and ``\cvqual{cv2} \tcode{T2}'',
3459+
``\cvqual{cv1} \tcode{T1}'' is \defn{reference-related} to
3460+
``\cvqual{cv2} \tcode{T2}'' if
34623461
\tcode{T1} is the same type as \tcode{T2}, or
34633462
\tcode{T1} is a base class of \tcode{T2}.
3464-
``\nonterminal{cv1} \tcode{T1}'' is \nonterminal{reference-compatible}
3465-
\indextext{reference-compatible}%
3466-
with ``\nonterminal{cv2} \tcode{T2}'' if
3463+
``\cvqual{cv1} \tcode{T1}'' is \defn{reference-compatible}
3464+
with ``\cvqual{cv2} \tcode{T2}'' if
34673465
\begin{itemize}
34683466
\item \tcode{T1} is reference-related to \tcode{T2}, or
34693467
\item \tcode{T2} is ``\tcode{noexcept} function'' and \tcode{T1} is ``function'',
@@ -3497,15 +3495,15 @@
34973495
\item
34983496
is an lvalue (but is not a
34993497
bit-field), and
3500-
``\nonterminal{cv1} \tcode{T1}'' is reference-compatible with
3501-
``\nonterminal{cv2} \tcode{T2}'', or
3498+
``\cvqual{cv1} \tcode{T1}'' is reference-compatible with
3499+
``\cvqual{cv2} \tcode{T2}'', or
35023500
\item
35033501
has a class type (i.e.,
35043502
\tcode{T2}
35053503
is a class type), where \tcode{T1} is not reference-related to \tcode{T2}, and can be converted
3506-
to an lvalue of type ``\nonterminal{cv3} \tcode{T3}'', where
3507-
``\nonterminal{cv1} \tcode{T1}'' is reference-compatible with
3508-
``\nonterminal{cv3} \tcode{T3}''\footnote{This requires a conversion
3504+
to an lvalue of type ``\cvqual{cv3} \tcode{T3}'', where
3505+
``\cvqual{cv1} \tcode{T1}'' is reference-compatible with
3506+
``\cvqual{cv3} \tcode{T3}''\footnote{This requires a conversion
35093507
function~(\ref{class.conv.fct}) returning a reference type.}
35103508
(this conversion is selected by enumerating the applicable conversion
35113509
functions (\ref{over.match.ref}) and choosing the best one through overload
@@ -3605,7 +3603,7 @@
36053603
\tcode{T1} is not reference-related to \tcode{T2},
36063604
user-defined conversions are considered
36073605
using the rules for copy-initialization of an object of type
3608-
``\nonterminal{cv1} \tcode{T1}'' by
3606+
``\cvqual{cv1} \tcode{T1}'' by
36093607
user-defined conversion
36103608
(\ref{dcl.init}, \ref{over.match.copy}, \ref{over.match.conv});
36113609
the program is ill-formed if the corresponding non-reference
@@ -3616,7 +3614,7 @@
36163614
\item
36173615
Otherwise,
36183616
the initializer expression is implicitly converted to a prvalue
3619-
of type ``\nonterminal{cv1} \tcode{T1}''.
3617+
of type ``\cvqual{cv1} \tcode{T1}''.
36203618
The temporary materialization conversion is applied and the reference is
36213619
bound to the result.
36223620
\end{itemize}

source/expressions.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@
14241424

14251425
\pnum
14261426
\begin{note} The \tcode{>} token following the
1427-
\nonterminal{type-id} in a \tcode{dynamic_cast},
1427+
\grammarterm{type-id} in a \tcode{dynamic_cast},
14281428
\tcode{static_cast}, \tcode{reinterpret_cast}, or
14291429
\tcode{const_cast} may be the product of replacing a
14301430
\tcode{>{>}} token by two consecutive \tcode{>}
@@ -3023,19 +3023,19 @@
30233023

30243024
\pnum
30253025
If a placeholder type~(\ref{dcl.spec.auto}) appears in the
3026-
\nonterminal{type-specifier-seq} of a \nonterminal{new-type-id} or
3027-
\nonterminal{type-id} of a \nonterminal{new-expression},
3028-
the \nonterminal{new-expression} shall contain a
3029-
\nonterminal{new-initializer} of the form
3026+
\grammarterm{type-specifier-seq} of a \grammarterm{new-type-id} or
3027+
\grammarterm{type-id} of a \grammarterm{new-expression},
3028+
the \grammarterm{new-expression} shall contain a
3029+
\grammarterm{new-initializer} of the form
30303030

30313031
\begin{ncsimplebnf}
30323032
\terminal{(} assignment-expression \terminal{)}
30333033
\end{ncsimplebnf}
30343034

3035-
The allocated type is deduced from the \nonterminal{new-initializer} as
3036-
follows: Let \tcode{e} be the \grammarterm{assignment-expression} in the \nonterminal{new-initializer} and
3037-
\tcode{T} be the \nonterminal{new-type-id} or \nonterminal{type-id} of
3038-
the \nonterminal{new-expression}, then the allocated type is the type
3035+
The allocated type is deduced from the \grammarterm{new-initializer} as
3036+
follows: Let \tcode{e} be the \grammarterm{assignment-expression} in the \grammarterm{new-initializer} and
3037+
\tcode{T} be the \grammarterm{new-type-id} or \grammarterm{type-id} of
3038+
the \grammarterm{new-expression}, then the allocated type is the type
30393039
deduced for the variable \tcode{x} in the invented
30403040
declaration~(\ref{dcl.spec.auto}):
30413041

source/overloading.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,8 +1329,8 @@
13291329
\tcode{S}
13301330
and yield type ``lvalue reference to \cvqual{cv2} \tcode{T2}''
13311331
(when initializing an lvalue reference or an rvalue reference to function) or
1332-
``\nonterminal{cv2} \tcode{T2}''
1333-
or ``rvalue reference to \nonterminal{cv2} \tcode{T2}'' (when initializing an
1332+
``\cvqual{cv2} \tcode{T2}''
1333+
or ``rvalue reference to \cvqual{cv2} \tcode{T2}'' (when initializing an
13341334
rvalue reference or an lvalue reference to function),
13351335
where ``\cvqual{cv1} \tcode{T}'' is reference-compatible~(\ref{dcl.init.ref})
13361336
with ``\cvqual{cv2} \tcode{T2}'',

source/special.tex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,10 +1683,10 @@
16831683
A \grammarterm{mem-initializer-list} can delegate to another
16841684
constructor of the constructor's class using any
16851685
\grammarterm{class-or-decltype} that denotes the constructor's class itself. If a
1686-
\nonterminal{mem-initializer-id} designates the constructor's class,
1687-
it shall be the only \nonterminal{mem-initializer}; the constructor
1686+
\grammarterm{mem-initializer-id} designates the constructor's class,
1687+
it shall be the only \grammarterm{mem-initializer}; the constructor
16881688
is a \term{delegating constructor}, and the constructor selected by the
1689-
\nonterminal{mem-initializer} is the \term{target constructor}.
1689+
\grammarterm{mem-initializer} is the \term{target constructor}.
16901690
The target constructor is selected by overload resolution.
16911691
Once the target constructor returns, the body of the delegating constructor
16921692
is executed. If a constructor delegates to itself directly or indirectly,
@@ -3120,22 +3120,22 @@
31203120
omitted by constructing the automatic object directly
31213121
into the function call's return object
31223122

3123-
\item in a \nonterminal{throw-expression}~(\ref{expr.throw}), when the operand
3123+
\item in a \grammarterm{throw-expression}~(\ref{expr.throw}), when the operand
31243124
is the name of a non-volatile automatic object
31253125
(other than a function or catch-clause parameter)
31263126
whose scope does not extend beyond the end of the innermost enclosing
31273127
\grammarterm{try-block} (if there is one), the copy/move operation from the
31283128
operand to the exception object~(\ref{except.throw}) can be omitted by
31293129
constructing the automatic object directly into the exception object
31303130

3131-
\item when the \nonterminal{exception-declaration} of an
3131+
\item when the \grammarterm{exception-declaration} of an
31323132
exception handler (Clause~\ref{except}) declares an object of the same
31333133
type (except for cv-qualification) as the exception
31343134
object~(\ref{except.throw}), the copy operation can be omitted by treating
3135-
the \nonterminal{exception-declaration} as an alias for the exception
3135+
the \grammarterm{exception-declaration} as an alias for the exception
31363136
object if the meaning of the program will be unchanged except for the execution
31373137
of constructors and destructors for the object declared by the
3138-
\nonterminal{exception-declaration}.
3138+
\grammarterm{exception-declaration}.
31393139
\begin{note} There cannot be a move from the exception object because it is
31403140
always an lvalue. \end{note}
31413141
\end{itemize}

source/statements.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
\grammarterm{selection-statement}{s} and to the \tcode{for} and \tcode{while}
3838
statements~(\ref{stmt.iter}). The \grammarterm{declarator} shall not
3939
specify a function or an array. The \grammarterm{decl-specifier-seq} shall not
40-
define a class or enumeration. If the \tcode{auto} \nonterminal{type-specifier} appears in
41-
the \nonterminal{decl-specifier-seq},
40+
define a class or enumeration. If the \tcode{auto} \grammarterm{type-specifier} appears in
41+
the \grammarterm{decl-specifier-seq},
4242
the type of the identifier being declared is deduced from the initializer as described in~\ref{dcl.spec.auto}.
4343

4444
\pnum

source/templates.tex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
\end{bnf}
2626

2727
\begin{note} The \tcode{>} token following the
28-
\nonterminal{template-parameter-list} of a
29-
\nonterminal{template-declaration}
28+
\grammarterm{template-parameter-list} of a
29+
\grammarterm{template-declaration}
3030
may be the product of replacing a
3131
\tcode{>{>}} token by two consecutive \tcode{>}
3232
tokens~(\ref{temp.names}).\end{note}
@@ -193,8 +193,8 @@
193193
\end{bnf}
194194

195195
\begin{note} The \tcode{>} token following the
196-
\nonterminal{template-parameter-list} of a
197-
\nonterminal{type-parameter}
196+
\grammarterm{template-parameter-list} of a
197+
\grammarterm{type-parameter}
198198
may be the product of replacing a
199199
\tcode{>{>}} token by two consecutive \tcode{>}
200200
tokens~(\ref{temp.names}).\end{note}
@@ -624,10 +624,10 @@
624624
rather than a greater-than operator.
625625
Similarly, the first non-nested \tcode{>{>}} is treated as two
626626
consecutive but distinct \tcode{>} tokens, the first of which is taken
627-
as the end of the \nonterminal{template-argument-list} and completes
628-
the \nonterminal{template-id}. \begin{note} The second \tcode{>}
627+
as the end of the \grammarterm{template-argument-list} and completes
628+
the \grammarterm{template-id}. \begin{note} The second \tcode{>}
629629
token produced by this replacement rule may terminate an enclosing
630-
\nonterminal{template-id} construct or it may be part of a different
630+
\grammarterm{template-id} construct or it may be part of a different
631631
construct (e.g. a cast).\end{note}
632632
\begin{example}
633633

@@ -3037,13 +3037,13 @@
30373037
\end{example}
30383038

30393039
\pnum
3040-
When a \nonterminal{qualified-id} is intended to refer to a type
3040+
When a \grammarterm{qualified-id} is intended to refer to a type
30413041
that is not a member of the current instantiation~(\ref{temp.dep.type})
3042-
and its \nonterminal{nested-name-specifier}
3042+
and its \grammarterm{nested-name-specifier}
30433043
refers to a dependent type,
30443044
it shall be
30453045
prefixed by the keyword \tcode{typename}, forming a
3046-
\nonterminal{typename-specifier}.
3046+
\grammarterm{typename-specifier}.
30473047
If the \grammarterm{qualified-id} in a \grammarterm{typename-specifier}
30483048
does not denote a type
30493049
or a class template,

0 commit comments

Comments
 (0)