Skip to content

Commit 5485b45

Browse files
committed
Apply suggested changes
1 parent 00202a5 commit 5485b45

File tree

1 file changed

+88
-186
lines changed

1 file changed

+88
-186
lines changed

source/declarations.tex

Lines changed: 88 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,25 +2519,15 @@
25192519
both the \grammarterm{decl-specifier-seq} and its \grammarterm{declarator}.
25202520

25212521
\pnum
2522-
Thus, a declaration of a particular identifier has the form
2523-
\tcode{T} \tcode{D} where \tcode{T}
2524-
is of the form \opt{\grammarterm{attribute-specifier-seq}}
2525-
\grammarterm{decl-specifier-seq}
2526-
and \tcode{D} is a declarator.
2527-
Following is a recursive procedure for determining
2528-
the type specified for the contained
2529-
\grammarterm{declarator-id}
2530-
by such a declaration.
2522+
Thus, a declaration of a particular \grammarterm{declarator-id} has the form
2523+
\opt{\grammarterm{attribute-specifier-seq}} \grammarterm{decl-specifier-seq}
2524+
\grammarterm{declarator}. The optional \grammarterm{attribute-specifier-seq}
2525+
appertains to the declared entity. Following is a recursive procedure for
2526+
determining the type of the \grammarterm{declarator-id} and the entity which it declares.
25312527

25322528
\pnum
2533-
First, the type \tcode{T} is determined.
2534-
In a declaration of the form
2535-
\begin{ncsimplebnf}
2536-
\opt{attribute-specifier-seq} decl-specifier-seq \terminal{D}
2537-
\end{ncsimplebnf}
2538-
the \grammarterm{decl-specifier-seq} determines the type \tcode{T}.
2539-
The optional \grammarterm{attribute-specifier-seq} appertains
2540-
to the entity declared by \tcode{D}.
2529+
First, a type \tcode{T} is determined from
2530+
the \grammarterm{decl-specifier-seq}.
25412531
\begin{example}
25422532
In the declaration
25432533
\begin{codeblock}
@@ -2551,27 +2541,20 @@
25512541
\end{example}
25522542

25532543
\pnum
2554-
In a declaration \tcode{T} \tcode{D}
2555-
where \tcode{D} has the form
2544+
A \grammarterm{declarator} of the form
25562545
\begin{ncsimplebnf}
25572546
declarator-id \opt{attribute-specifier-seq}
25582547
\end{ncsimplebnf}
2559-
the type of the \grammarterm{declarator-id}
2560-
in \tcode{D} is ``\tcode{T}''.
2548+
determines the type of its
2549+
\grammarterm{declarator-id} to be ``\tcode{T}''.
25612550
The optional \grammarterm{attribute-specifier-seq}
2562-
appertains to the entity declared by \tcode{D}.
2551+
appertains to the declared entity.
25632552

25642553
\pnum
2565-
In a declaration
2566-
\tcode{T} \tcode{D} where
2567-
\tcode{D} has the form
2568-
\begin{ncsimplebnf}
2569-
\terminal{(} \terminal{D1} \terminal{)}
2570-
\end{ncsimplebnf}
2571-
the type of the \grammarterm{declarator-id}
2572-
in \tcode{D} is the same as that of the
2573-
contained \grammarterm{declarator-id}
2574-
in the declaration \tcode{T} \tcode{D1}.
2554+
A \grammarterm{declarator} of the form \tcode{(D)}
2555+
determines the type of its \grammarterm{declarator-id}
2556+
to be that of the \grammarterm{declarator-id}
2557+
in the declaration \tcode{T} \tcode{D}.
25752558
\indextext{declaration!parentheses in}%
25762559
\begin{note}
25772560
Parentheses do not alter the type of the embedded
@@ -2583,34 +2566,20 @@
25832566
\indextext{declarator!pointer}%
25842567

25852568
\pnum
2586-
In a declaration
2587-
\tcode{T}
2588-
\tcode{D}
2589-
where
2590-
\tcode{D}
2591-
has the form
2569+
A \grammarterm{declarator} of the form
25922570
\begin{ncsimplebnf}
2593-
\terminal{*} \opt{attribute-specifier-seq} \opt{cv-qualifier-seq} \terminal{D1}
2571+
\terminal{*} \opt{attribute-specifier-seq} \opt{cv-qualifier-seq} \terminal{D}
25942572
\end{ncsimplebnf}
2595-
and the type of the contained
2596-
\grammarterm{declarator-id}
2597-
in the declaration
2598-
\tcode{T}
2599-
\tcode{D1}
2600-
is ``\placeholder{derived-declarator-type-list}
2601-
\tcode{T}'',
2602-
then the type of the
2603-
\grammarterm{declarator-id}
2604-
in
2605-
\tcode{D}
2606-
is ``\placeholder{derived-declarator-type-list} \grammarterm{cv-qualifier-seq} pointer to
2607-
\tcode{T}''.
2573+
determines the type of its \grammarterm{declarator-id} to be
2574+
that of the \grammarterm{declarator-id} in the declaration
2575+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier} denoting
2576+
the type ``\grammarterm{cv-qualifier-seq} pointer to \tcode{T}''.
26082577
\indextext{declaration!pointer}%
26092578
\indextext{declaration!constant pointer}%
2610-
The
2611-
\grammarterm{cv-qualifier}{s}
2612-
apply to the pointer and not to the object pointed to.
2613-
Similarly, the optional \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar} appertains to the pointer and not to the object pointed to.
2579+
The \grammarterm{cv-qualifier}{s} apply to the pointer
2580+
and not to the object pointed to.
2581+
Similarly, the optional \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar}
2582+
appertains to the pointer and not to the object pointed to.
26142583

26152584
\pnum
26162585
\begin{example}
@@ -2692,29 +2661,15 @@
26922661
\indextext{declarator!reference}
26932662

26942663
\pnum
2695-
In a declaration
2696-
\tcode{T}
2697-
\tcode{D}
2698-
where
2699-
\tcode{D}
2700-
has either of the forms
2664+
A \grammarterm{declarator} having either of the forms
27012665
\begin{ncsimplebnf}
2702-
\terminal{\&} \opt{attribute-specifier-seq} \terminal{D1}\br
2703-
\terminal{\&\&} \opt{attribute-specifier-seq} \terminal{D1}
2666+
\terminal{\&} \opt{attribute-specifier-seq} \terminal{D}\br
2667+
\terminal{\&\&} \opt{attribute-specifier-seq} \terminal{D}
27042668
\end{ncsimplebnf}
2705-
and the type of the contained
2706-
\grammarterm{declarator-id}
2707-
in the declaration
2708-
\tcode{T}
2709-
\tcode{D1}
2710-
is ``\placeholder{derived-declarator-type-list}
2711-
\tcode{T}'',
2712-
then the type of the
2713-
\grammarterm{declarator-id}
2714-
in
2715-
\tcode{D}
2716-
is ``\placeholder{derived-declarator-type-list} reference to
2717-
\tcode{T}''.
2669+
determines the type of its \grammarterm{declarator-id} to be
2670+
that of the \grammarterm{declarator-id} in the declaration
2671+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier}
2672+
denoting the type ``reference to \tcode{T}''.
27182673
The optional \grammarterm{attribute-specifier-seq} appertains to the reference type.
27192674
Cv-qualified references are ill-formed except when the cv-qualifiers
27202675
are introduced through the use of a
@@ -2883,34 +2838,18 @@
28832838
\indextext{pointer to member}%
28842839

28852840
\pnum
2886-
In a declaration
2887-
\tcode{T}
2888-
\tcode{D}
2889-
where
2890-
\tcode{D}
2891-
has the form
2841+
A \grammarterm{declarator} of the form
28922842
\begin{ncsimplebnf}
2893-
nested-name-specifier \terminal{*} \opt{attribute-specifier-seq} \opt{cv-qualifier-seq} \terminal{D1}
2843+
nested-name-specifier \terminal{*} \opt{attribute-specifier-seq} \opt{cv-qualifier-seq} \terminal{D}
28942844
\end{ncsimplebnf}
2895-
and the
2896-
\grammarterm{nested-name-specifier}
2897-
denotes a class,
2898-
and the type of the contained
2899-
\grammarterm{declarator-id}
2900-
in the declaration
2901-
\tcode{T}
2902-
\tcode{D1}
2903-
is ``\placeholder{derived-declarator-type-list}
2904-
\tcode{T}'',
2905-
then the type of the
2906-
\grammarterm{declarator-id}
2907-
in
2908-
\tcode{D}
2909-
is ``\placeholder{derived-declarator-type-list} \grammarterm{cv-qualifier-seq} pointer to member of class
2910-
\grammarterm{nested-name-specifier} of type
2911-
\tcode{T}''.
2912-
The optional \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar} appertains to the
2913-
pointer-to-member.
2845+
where the \grammarterm{nested-name-specifier} denotes a class type
2846+
determines the type of its \grammarterm{declarator-id} to be
2847+
that of the \grammarterm{declarator-id} in the declaration
2848+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier}
2849+
denoting the type ``\grammarterm{cv-qualifier-seq} pointer to member of class
2850+
\grammarterm{nested-name-specifier} of type \tcode{T}''.
2851+
The optional \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar}
2852+
appertains to the pointer-to-member.
29142853

29152854
\pnum
29162855
\begin{example}
@@ -2992,42 +2931,38 @@
29922931
\indextext{declarator!array}
29932932

29942933
\pnum
2995-
In a declaration \tcode{T} \tcode{D} where \tcode{D} has the form
2934+
A \grammarterm{declarator} of the form
29962935
\begin{ncsimplebnf}
2997-
\terminal{D1} \terminal{[} \opt{constant-expression} \terminal{]} \opt{attribute-specifier-seq}
2936+
\terminal{D} \terminal{[} constant-expression \terminal{]} \opt{attribute-specifier-seq}
29982937
\end{ncsimplebnf}
2999-
and the type of the contained \grammarterm{declarator-id}
3000-
in the declaration \tcode{T} \tcode{D1}
3001-
is ``\placeholder{derived-declarator-type-list} \tcode{T}'',
3002-
the type of the \grammarterm{declarator-id} in \tcode{D} is
3003-
``\placeholder{derived-declarator-type-list} array of \tcode{N} \tcode{T}''.
3004-
The \grammarterm{constant-expression}
3005-
shall be a converted constant expression of type \tcode{std::size_t}\iref{expr.const}.
2938+
where the \grammarterm{constant-expression} is a converted constant expression
2939+
of type \tcode{std::size_t}\iref{expr.const}
2940+
determines the type of its \grammarterm{declarator-id} to be
2941+
that of the \grammarterm{declarator-id} in the declaration
2942+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier}
2943+
denoting the type ``array of \tcode{N} \tcode{T}'' and \tcode{N} is the
2944+
value of the \grammarterm{constant-expression}.
30062945
\indextext{bound, of array}%
3007-
Its value \tcode{N} specifies the \defnx{array bound}{array!bound},
3008-
i.e., the number of elements in the array;
3009-
\tcode{N} shall be greater than zero.
2946+
The \defnx{array bound}{array!bound} \tcode{N} shall be greater than zero.
2947+
The optional \grammarterm{attribute-specifier-seq}
2948+
appertains to the array type.
30102949

30112950
\pnum
3012-
In a declaration \tcode{T} \tcode{D} where \tcode{D} has the form
2951+
A \grammarterm{declarator} of the form
30132952
\begin{ncsimplebnf}
3014-
\terminal{D1 [ ]} \opt{attribute-specifier-seq}
2953+
\terminal{D [ ]} \opt{attribute-specifier-seq}
30152954
\end{ncsimplebnf}
3016-
and the type of the contained \grammarterm{declarator-id}
3017-
in the declaration \tcode{T} \tcode{D1}
3018-
is ``\placeholder{derived-declarator-type-list} \tcode{T}'',
3019-
the type of the \grammarterm{declarator-id} in \tcode{D} is
3020-
``\placeholder{derived-declarator-type-list} array of unknown bound of \tcode{T}'', except as specified below.
2955+
determines the type of its \grammarterm{declarator-id} to be
2956+
that of the \grammarterm{declarator-id} in the declaration
2957+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier}
2958+
denoting the type ``array of unknown bound of \tcode{T}'', except as specified below.
2959+
The optional \grammarterm{attribute-specifier-seq} appertains to the array type.
30212960

30222961
\pnum
30232962
\indextext{declaration!array}%
3024-
A type of the form ``array of \tcode{N} \tcode{U}'' or
3025-
``array of unknown bound of \tcode{U}'' is an \defn{array type}.
3026-
The optional \grammarterm{attribute-specifier-seq}
3027-
appertains to the array type.
3028-
3029-
\pnum
3030-
\tcode{U} is called the array \defn{element type};
2963+
A type of the form ``array of \tcode{N} \tcode{E}'' or
2964+
``array of unknown bound of \tcode{E}'' is an \defn{array type}.
2965+
\tcode{E} is called the array \defn{element type};
30312966
this type shall not be
30322967
a placeholder type\iref{dcl.spec.auto},
30332968
a reference type,
@@ -3053,10 +2988,10 @@
30532988

30542989
\pnum
30552990
Any type of the form
3056-
``\grammarterm{cv-qualifier-seq} array of \tcode{N} \tcode{U}''
2991+
``\grammarterm{cv-qualifier-seq} array of \tcode{N} \tcode{E}''
30572992
is adjusted to
3058-
``array of \tcode{N} \grammarterm{cv-qualifier-seq} \tcode{U}'',
3059-
and similarly for ``array of unknown bound of \tcode{U}''.
2993+
``array of \tcode{N} \grammarterm{cv-qualifier-seq} \tcode{E}'',
2994+
and similarly for ``array of unknown bound of \tcode{E}''.
30602995
\begin{example}
30612996
\begin{codeblock}
30622997
typedef int A[5], AA[2][3];
@@ -3065,14 +3000,14 @@
30653000
\end{codeblock}
30663001
\end{example}
30673002
\begin{note}
3068-
An ``array of \tcode{N} \grammarterm{cv-qualifier-seq} \tcode{U}''
3003+
An ``array of \tcode{N} \grammarterm{cv-qualifier-seq} \tcode{E}''
30693004
has cv-qualified type; see~\ref{basic.type.qualifier}.
30703005
\end{note}
30713006

30723007
\pnum
3073-
An object of type ``array of \tcode{N} \tcode{U}'' contains
3008+
An object of type ``array of \tcode{N} \tcode{E}'' contains
30743009
a contiguously allocated non-empty set
3075-
of \tcode{N} subobjects of type \tcode{U},
3010+
of \tcode{N} subobjects of type \tcode{E},
30763011
known as the \defnx{elements}{array!element} of the array,
30773012
and numbered \tcode{0} to \tcode{N-1}.
30783013

@@ -3088,7 +3023,7 @@
30883023
In these cases, the array bound is calculated
30893024
from the number of initial elements (say, \tcode{N})
30903025
supplied\iref{dcl.init.aggr},
3091-
and the type of the array is ``array of \tcode{N} \tcode{U}''.
3026+
and the type of the array is ``array of \tcode{N} \tcode{E}''.
30923027

30933028
\pnum
30943029
Furthermore, if there is a preceding declaration of the entity in the same
@@ -3194,34 +3129,17 @@
31943129

31953130
\pnum
31963131
\indextext{type!function}%
3197-
In a declaration
3198-
\tcode{T}
3199-
\tcode{D}
3200-
where
3201-
\tcode{D}
3202-
has the form
3132+
A \grammarterm{declarator} of the form
32033133
\begin{ncsimplebnf}
3204-
\terminal{D1} \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br
3134+
\terminal{D} \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br
32053135
\bnfindent\opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq}
32063136
\end{ncsimplebnf}
3207-
and the type of the contained
3208-
\grammarterm{declarator-id}
3209-
in the declaration
3210-
\tcode{T}
3211-
\tcode{D1}
3212-
is
3213-
``\placeholder{derived-declarator-type-list}
3214-
\tcode{T}'',
3215-
the type of the
3216-
\grammarterm{declarator-id}
3217-
in
3218-
\tcode{D}
3219-
is
3220-
``\placeholder{derived-declarator-type-list}
3221-
\opt{\tcode{noexcept}}
3222-
function of parameter-type-list
3137+
determines the type of its \grammarterm{declarator-id} to be
3138+
that of the \grammarterm{declarator-id} in the declaration
3139+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier}
3140+
denoting the type ``\opt{\tcode{noexcept}} function of parameter-type-list
32233141
\opt{\grammarterm{cv-qualifier-seq}} \opt{\grammarterm{ref-qualifier}}
3224-
returning \tcode{T}'', where
3142+
returning \tcode{T}'', and
32253143
\begin{itemize}
32263144
\item
32273145
the parameter-type-list is derived from
@@ -3231,43 +3149,27 @@
32313149
the exception specification\iref{except.spec} is non-throwing.
32323150
\end{itemize}
32333151
The optional \grammarterm{attribute-specifier-seq}
3234-
appertains to the function type.
3152+
appertains to the function type.
32353153

32363154
\pnum
3237-
In a declaration
3238-
\tcode{T}
3239-
\tcode{D}
3240-
where
3241-
\tcode{D}
3242-
has the form
3155+
A \grammarterm{declarator} of the form
32433156
\begin{ncsimplebnf}
3244-
\terminal{D1} \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br
3157+
\terminal{D} \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br
32453158
\bnfindent\opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq} trailing-return-type
32463159
\end{ncsimplebnf}
3247-
and the type of the contained
3248-
\grammarterm{declarator-id}
3249-
in the declaration
3250-
\tcode{T}
3251-
\tcode{D1}
3252-
is
3253-
``\placeholder{derived-declarator-type-list} \tcode{T}'',
3254-
\tcode{T} shall be the single \grammarterm{type-specifier} \tcode{auto}.
3255-
The type of the
3256-
\grammarterm{declarator-id}
3257-
in
3258-
\tcode{D}
3259-
is
3260-
``\placeholder{derived-declarator-type-list}
3261-
\opt{\tcode{noexcept}}
3262-
function of parameter-type-list
3160+
where \tcode{T} has the form ``\placeholder{type-list} \tcode{auto}'',
3161+
the type of its \grammarterm{declarator-id} is determined to be
3162+
that of the \grammarterm{declarator-id} in the declaration
3163+
\tcode{U} \tcode{D}, where \tcode{U} is a \grammarterm{type-specifier}
3164+
denoting the type ``\opt{\tcode{noexcept}} function of parameter-type-list
32633165
\opt{\grammarterm{cv-qualifier-seq}} \opt{\grammarterm{ref-qualifier}}
3264-
returning \tcode{U}'', where
3166+
returning \tcode{V}'', and
32653167
\begin{itemize}
32663168
\item
32673169
the parameter-type-list is derived from
32683170
the \grammarterm{parameter-declaration-clause} as described below,
32693171
\item
3270-
\tcode{U} is the type specified by the \grammarterm{trailing-return-type}, and
3172+
\tcode{V} is the type specified by the \grammarterm{trailing-return-type}, and
32713173
\item
32723174
the optional \tcode{noexcept} is present if and only if
32733175
the exception specification is non-throwing.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy