Skip to content

Commit be747ec

Browse files
committed
expr.* (rest)
1 parent 8e6a813 commit be747ec

File tree

1 file changed

+73
-54
lines changed

1 file changed

+73
-54
lines changed

source/expressions.tex

Lines changed: 73 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,7 +3066,7 @@
30663066
\end{codeblock}
30673067
\end{example}
30683068
If the function is a non-static member
3069-
function, the \tcode{this} parameter of the function\iref{class.this}
3069+
function, the \tcode{this} parameter of the function\iref{expr.prim.this}
30703070
is initialized with a pointer to the object of the call, converted
30713071
as if by an explicit type conversion\iref{expr.cast}.
30723072
\begin{note}
@@ -3093,7 +3093,7 @@
30933093
The access of the constructor, conversion functions or destructor is
30943094
checked at the point of call in the calling function. If a constructor
30953095
or destructor for a function parameter throws an exception, the search
3096-
for a handler starts in the scope of the calling function; in
3096+
for a handler starts in the calling function; in
30973097
particular, if the function called has a \grammarterm{function-try-block}\iref{except.pre}
30983098
with a handler that could handle the exception,
30993099
this handler is not considered.
@@ -3287,7 +3287,7 @@
32873287
\indextext{arrow operator|see{operator, class member access}}%
32883288
A postfix expression followed by a dot \tcode{.} or an arrow \tcode{->},
32893289
optionally followed by the keyword
3290-
\keyword{template}\iref{temp.names}, and then followed by an
3290+
\keyword{template}, and then followed by an
32913291
\grammarterm{id-expression}, is a postfix expression. The postfix
32923292
expression before the dot or arrow is evaluated;
32933293
\begin{footnote}
@@ -3300,6 +3300,13 @@
33003300
the result of that evaluation, together with the
33013301
\grammarterm{id-expression}, determines the result of the entire postfix
33023302
expression.
3303+
\begin{note}
3304+
If the keyword \keyword{template} is used,
3305+
the following unqualified name
3306+
is considered to refer to a template\iref{temp.names}.
3307+
If a \grammarterm{simple-template-id} results and is followed by a \tcode{::},
3308+
the \grammarterm{id-expression} is a \grammarterm{qualified-id}.
3309+
\end{note}
33033310

33043311
\pnum
33053312
\indextext{type!incomplete}%
@@ -3332,16 +3339,8 @@
33323339
The class type shall be complete
33333340
unless the class member access appears in the definition of that class.
33343341
\begin{note}
3335-
If the class is incomplete,
3336-
lookup in the complete class type is required to refer
3337-
to the same declaration\iref{basic.scope.class}.
3338-
\end{note}
3339-
The \grammarterm{id-expression} shall name a member of the class or of one of
3340-
its base classes.
3341-
\begin{note}
3342-
Because the name of a class is inserted in its class scope\iref{class},
3343-
the name of a class is also considered a nested
3344-
member of that class.
3342+
The program is ill-formed if the result differs from that
3343+
when the class is complete\iref{class.member.lookup}.
33453344
\end{note}
33463345
\begin{note}
33473346
\ref{basic.lookup.qual} describes how names are looked up after the
@@ -3384,7 +3383,7 @@
33843383
\tcode{mutable} member, then the type of \tcode{E1.E2} is
33853384
``\cvqual{cq12} \cvqual{vq12} \tcode{T}''.
33863385

3387-
\item If \tcode{E2} is a (possibly overloaded) member function,
3386+
\item If \tcode{E2} is an overload set,
33883387
function overload resolution\iref{over.match}
33893388
is used to select the function to which \tcode{E2} refers.
33903389
The type of \tcode{E1.E2} is the type of \tcode{E2}
@@ -4360,9 +4359,9 @@
43604359
\pnum
43614360
\indextext{overloaded function!address of}%
43624361
\begin{note}
4363-
The address of an overloaded function\iref{over} can be taken
4364-
only in a context that uniquely determines which version of the
4365-
overloaded function is referred to (see~\ref{over.over}).
4362+
The address of an overload set\iref{over} can be taken
4363+
only in a context that uniquely determines
4364+
which function is referred to (see~\ref{over.over}).
43664365
Since the context might determine whether the operand is a static or
43674366
non-static member function, the context can also affect whether the
43684367
expression has type ``pointer to function'' or ``pointer to member
@@ -4474,7 +4473,7 @@
44744473
An \grammarterm{await-expression} shall not appear in a
44754474
default argument\iref{dcl.fct.default}.
44764475
An \grammarterm{await-expression} shall not appear in the initializer of
4477-
a block-scope variable with static or thread storage duration.
4476+
a block variable with static or thread storage duration.
44784477
A context within a function where an \grammarterm{await-expression} can appear
44794478
is called a \term{suspension context} of the function.
44804479

@@ -4488,14 +4487,14 @@
44884487
object\iref{dcl.fct.def.coroutine}
44894488
of the enclosing coroutine and \tcode{P} is the type of that object.
44904489

4491-
\item \placeholder{a} is the \grammarterm{cast-expression} if
4490+
\item Unless
44924491
the \grammarterm{await-expression} was implicitly produced by a
44934492
\grammarterm{yield-expression}\iref{expr.yield}, an initial suspend point,
4494-
or a final suspend point\iref{dcl.fct.def.coroutine}.
4495-
Otherwise, the \grammarterm{unqualified-id} \tcode{await_transform} is
4496-
looked up within the scope of \tcode{P} by class member access
4497-
lookup\iref{basic.lookup.qual},
4498-
and if this lookup finds at least one declaration, then \placeholder{a} is
4493+
or a final suspend point\iref{dcl.fct.def.coroutine},
4494+
a search is performed for the name \tcode{await_transform}
4495+
in the scope of \tcode{P} \iref{class.member.lookup}.
4496+
If this search is performed and finds at least one declaration,
4497+
then \placeholder{a} is
44994498
\mbox{\placeholder{p}\tcode{.await_transform(}\grammarterm{cast-expression}\tcode{)}};
45004499
otherwise, \placeholder{a} is the \grammarterm{cast-expression}.
45014500

@@ -5040,13 +5039,14 @@
50405039

50415040
\pnum
50425041
\indextext{operator!scope resolution}%
5043-
If the \grammarterm{new-expression} begins with a unary \tcode{::}
5044-
operator, the allocation function's name is looked up in the global
5045-
scope. Otherwise, if the allocated type is a class type \tcode{T} or
5046-
array thereof, the allocation function's name is looked up in the scope
5047-
of \tcode{T}. If this lookup fails to find the name, or if the allocated
5048-
type is not a class type, the allocation function's name is looked up in
5049-
the global scope.
5042+
If the \grammarterm{new-expression}
5043+
does not begin with a unary \tcode{::} operator and
5044+
the allocated type is a class type \tcode{T} or array thereof,
5045+
a search is performed for the allocation function's name in the scope
5046+
of \tcode{T}\iref{class.member.lookup}.
5047+
Otherwise, or if nothing is found,
5048+
the allocation function's name is looked up by
5049+
searching for it in the global scope.
50505050

50515051
\pnum
50525052
An implementation is allowed to omit a call to a replaceable global allocation
@@ -5280,7 +5280,7 @@
52805280
\pnum
52815281
If the \grammarterm{new-expression} creates an object or an array of
52825282
objects of class type, access and ambiguity control are done for the
5283-
allocation function, the deallocation function\iref{class.free}, and
5283+
allocation function, the deallocation function\iref{basic.stc.dynamic.deallocation}, and
52845284
the constructor\iref{class.ctor} selected for the initialization (if any).
52855285
If the \grammarterm{new-expression}
52865286
creates an array of objects of class type, the destructor is potentially
@@ -5307,13 +5307,14 @@
53075307
\end{note}
53085308

53095309
\pnum
5310-
If the \grammarterm{new-expression} begins with a unary \tcode{::}
5311-
operator, the deallocation function's name is looked up in the global
5312-
scope. Otherwise, if the allocated type is a class type \tcode{T} or an
5313-
array thereof, the deallocation function's name is looked up in the
5314-
scope of \tcode{T}. If this lookup fails to find the name, or if the
5315-
allocated type is not a class type or array thereof, the deallocation
5316-
function's name is looked up in the global scope.
5310+
If the \grammarterm{new-expression} does not begin with
5311+
a unary \tcode{::} operator and
5312+
the allocated type is a class type \tcode{T} or an array thereof,
5313+
a search is performed for the deallocation function's name
5314+
in the scope of \tcode{T}.
5315+
Otherwise, or if nothing is found,
5316+
the deallocation function's name is looked up by
5317+
searching for it in the global scope.
53175318

53185319
\pnum
53195320
A declaration of a placement deallocation function matches the
@@ -5502,27 +5503,45 @@
55025503
called as described above.
55035504

55045505
\pnum
5506+
If a deallocation function is called,
5507+
it is \tcode{operator delete} for a single-object delete expression or
5508+
\tcode{operator delete[]} for an array delete expression.
55055509
\begin{note}
5506-
An implementation provides default definitions of the global
5507-
deallocation functions \tcode{operator delete} for
5508-
non-arrays\iref{new.delete.single} and
55095510
\indextext{\idxcode{operator delete}}%
5510-
\tcode{operator delete[]} for arrays\iref{new.delete.array}. A \Cpp{}
5511-
program can provide alternative definitions of these
5511+
An implementation provides default definitions of the global
5512+
deallocation functions (\ref{new.delete.single}, \ref{new.delete.array}).
5513+
A \Cpp{} program can provide alternative definitions of these
55125514
functions\iref{replacement.functions}, and/or class-specific
55135515
versions\iref{class.free}.
55145516
\end{note}
55155517

55165518
\pnum
5517-
When the keyword \tcode{delete} in a \grammarterm{delete-expression} is
5518-
preceded by the unary \tcode{::} operator, the deallocation function's name is looked
5519-
up in global scope. Otherwise, the lookup considers class-specific deallocation
5520-
functions\iref{class.free}. If no class-specific deallocation function is found,
5521-
the deallocation function's name is looked up in global scope.
5519+
If the keyword \tcode{delete} in a \grammarterm{delete-expression}
5520+
is not preceded by the unary \tcode{::} operator and the type of the operand is
5521+
a pointer to a (possibly cv-qualified) class type \tcode{T}:
5522+
\begin{itemize}
5523+
\item
5524+
If \tcode{T} has a virtual destructor,
5525+
the deallocation function is the one selected at the point of definition of
5526+
the dynamic type's virtual destructor\iref{class.dtor}.
5527+
\item
5528+
Otherwise,
5529+
a search is performed for the deallocation function's name
5530+
in the scope of \tcode{T}.
5531+
\end{itemize}
5532+
Otherwise, or if nothing is found,
5533+
the deallocation function's name is looked up by
5534+
searching for it in the global scope.
5535+
In any case, any declarations
5536+
other than of usual deallocation functions\iref{basic.stc.dynamic.deallocation}
5537+
are discarded.
5538+
\begin{note}
5539+
If only a placement deallocation function is found in a class,
5540+
the program is ill-formed because the lookup set is empty\iref{basic.lookup}.
5541+
\end{note}
55225542

55235543
\pnum
5524-
If deallocation function lookup finds more than one usual
5525-
deallocation function,
5544+
If more than one deallocation function is found,
55265545
the function to be called is selected as follows:
55275546
\begin{itemize}
55285547
\item
@@ -5539,7 +5558,7 @@
55395558
If exactly one function remains,
55405559
that function is selected and the selection process terminates.
55415560
\item
5542-
If the deallocation functions have class scope,
5561+
If the deallocation functions belong to a class scope,
55435562
the one without a parameter of type \tcode{std::size_t} is selected.
55445563
\item
55455564
If the type is complete
@@ -7433,7 +7452,7 @@
74337452
\pnum
74347453
An expression or conversion is in an \defn{immediate function context}
74357454
if it is potentially evaluated and
7436-
its innermost non-block scope is
7455+
its innermost enclosing non-block scope is
74377456
a function parameter scope of an immediate function.
74387457
An expression or conversion is an \defn{immediate invocation}
74397458
if it is a potentially-evaluated explicit or implicit invocation of
@@ -7525,7 +7544,7 @@
75257544
that is potentially constant evaluated, or
75267545

75277546
\item
7528-
a variable whose name appears as a potentially constant evaluated expression
7547+
a variable named by a potentially constant evaluated expression
75297548
that is either a constexpr variable or
75307549
is of non-volatile const-qualified integral type or of reference type.
75317550
\end{itemize}

0 commit comments

Comments
 (0)