Skip to content

Commit

Permalink
[std] Consistently use 'overload set'.
Browse files Browse the repository at this point in the history
Define the term in [basic.lookup] and use it throughout.
Avoid the term 'set of overloaded functions', because it
is ambiguous with the declaration view in [over.load].
(An overload set might contain functions from different
scopes that cannot be overloaded per [over.load].)
  • Loading branch information
jensmaurer authored and zygoloid committed Jan 14, 2020
1 parent 54dc015 commit 24bb2a0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
21 changes: 11 additions & 10 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@
\begin{itemize}
\item
A function is named by an expression or conversion
if it is the unique result of a name lookup or the selected member
of a set of overloaded functions~(\ref{basic.lookup}, \ref{over.match}, \ref{over.over})
if it is the selected member
of an overload set~(\ref{basic.lookup}, \ref{over.match}, \ref{over.over})
in an overload resolution performed
as part of forming that expression or conversion,
unless it is a pure virtual function and either
Expand Down Expand Up @@ -1365,11 +1365,12 @@
such names in the context discussed by a particular rule. Name lookup
associates the use of a name with a set of declarations\iref{basic.def} of
that name.
The declarations found by name lookup shall either all denote the same entity or
shall all denote functions or function templates;
in the latter case,
the declarations are said to form a set of overloaded
functions\iref{over.load}. Overload resolution\iref{over.match}
If the declarations found by name lookup
all denote functions or function templates,
the declarations are said to form an \defn{overload set}.
The declarations found by name lookup shall either
all denote the same entity or form an overload set.
Overload resolution~(\ref{over.match}, \ref{over.over})
takes place after name lookup has succeeded. The access rules\iref{class.access}
are considered only once name lookup and
function overload resolution (if applicable) have succeeded. Only after
Expand Down Expand Up @@ -1846,12 +1847,12 @@
enclosing namespace is also included in the set. If an associated namespace
directly contains inline namespaces, those inline namespaces are also included
in the set.
In addition, if the argument is the name or address of a set of
overloaded functions and/or function templates, its associated entities
In addition, if the argument is the name or address of an overload set,
its associated entities
and namespaces are the union of those associated with each of the
members of the set, i.e., the entities and namespaces associated with its
parameter types and return type.
Additionally, if the aforementioned set of overloaded functions is named with
Additionally, if the aforementioned overload set is named with
a \grammarterm{template-id}, its associated entities and namespaces also include
those of its type \grammarterm{template-argument}{s} and its template
\grammarterm{template-argument}{s}.
Expand Down
3 changes: 1 addition & 2 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@
The linkages implied by successive declarations for a given entity shall
agree. That is, within a given scope, each declaration declaring the
same variable name or the same overloading of a function name shall imply
the same linkage. Each function in a given set of overloaded functions
can have a different linkage, however.
the same linkage.
\begin{example}
\begin{codeblock}
static char* f(); // \tcode{f()} has internal linkage
Expand Down
3 changes: 1 addition & 2 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2955,8 +2955,7 @@
initialized~(\ref{dcl.init}, \ref{class.copy.ctor}) with
its corresponding argument.
If there is no corresponding argument,
the default argument for the parameter is used;
the program is ill-formed if one is not present.
the default argument for the parameter is used.
\begin{example}
\begin{codeblock}
template<typename ...T> int f(int n = 0, T ...t);
Expand Down
15 changes: 8 additions & 7 deletions source/overloading.tex
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
and non-template functions\iref{dcl.fct} are treated equivalently
for the remainder of overload resolution.}
A given name can refer to one or more function templates and also
to a set of overloaded non-template functions.
to a set of non-template functions.
In such a case, the
candidate functions generated from each function template are combined
with the set of non-template candidate functions.
Expand Down Expand Up @@ -700,16 +700,17 @@
\begin{ncsimplebnf}
postfix-expression \terminal{(} \opt{expression-list} \terminal{)}
\end{ncsimplebnf}
if the \grammarterm{postfix-expression} denotes a set of overloaded functions and/or
function templates, overload resolution is applied as specified in \ref{over.call.func}.
if the \grammarterm{postfix-expression} names at least one function or
function template,
overload resolution is applied as specified in \ref{over.call.func}.
If the \grammarterm{postfix-expression} denotes an object of class type, overload
resolution is applied as specified in \ref{over.call.object}.

\pnum
If the \grammarterm{postfix-expression} denotes the address of a set of overloaded
functions and/or function templates, overload resolution is applied using that set as
described above. If the function selected by overload resolution is a non-static member
function, the program is ill-formed.
If the \grammarterm{postfix-expression} is the address of an overload set,
overload resolution is applied using that set as described above.
If the function selected by overload resolution is a non-static member function,
the program is ill-formed.
\begin{note}
The resolution of the address of an
overload set in other contexts is described in \ref{over.over}.
Expand Down
11 changes: 5 additions & 6 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1204,8 +1204,8 @@
of the type of the \grammarterm{template-parameter}.
\begin{note}
If the \grammarterm{template-argument}
represents a set of overloaded functions
(or a pointer or member pointer to such),
is an overload set
(or the address of such, including forming a pointer-to-member),
the matching function is selected from the set\iref{over.over}.
\end{note}

Expand Down Expand Up @@ -8368,17 +8368,16 @@
has a default argument that is being used in the call for which argument
deduction is being done.
\item
A function parameter for which argument deduction cannot be done because the
associated function argument is a function, or a set of overloaded
functions\iref{over.over}, and one or more of the following apply:
A function parameter for which the associated argument is an
overload set\iref{over.over}, and one or more of the following apply:
\begin{itemize}
\item
more than one function matches the function parameter type (resulting in
an ambiguous deduction), or
\item
no function matches the function parameter type, or
\item
the set of functions supplied as an argument contains one or more function templates.
the overload set supplied as an argument contains one or more function templates.
\end{itemize}
\item A function parameter for which the associated argument is an initializer
list\iref{dcl.init.list} but the parameter does not have
Expand Down

0 comments on commit 24bb2a0

Please sign in to comment.