Skip to content

Commit ecd4bcc

Browse files
author
Dawn Perchik
committed
CWG2092 Deduction failure and overload resolution
1 parent 0504682 commit ecd4bcc

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

source/expressions.tex

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,10 +2162,10 @@
21622162
the postfix expression shall be either an lvalue that refers to a
21632163
function (in which case the function-to-pointer standard
21642164
conversion\iref{conv.func} is suppressed on the postfix expression),
2165-
or it shall have function pointer type. Calling a function through an
2166-
expression whose function type is different
2167-
from the function type of the called function's
2168-
definition results in undefined behavior\iref{dcl.link}. For a call to a non-static
2165+
or it shall have function pointer type.
2166+
2167+
\pnum
2168+
For a call to a non-static
21692169
member function,
21702170
the postfix expression shall be an
21712171
implicit~(\ref{class.mfct.non-static}, \ref{class.static}) or explicit
@@ -2179,9 +2179,11 @@
21792179
A member function call of the form \tcode{f()} is interpreted as
21802180
\tcode{(*this).f()} (see~\ref{class.mfct.non-static}).
21812181
\end{note}
2182-
If a function or member function name is used, the name can be
2183-
overloaded\iref{over}, in which case the appropriate function
2184-
shall be selected according to the rules in~\ref{over.match}. If the selected
2182+
2183+
\pnum
2184+
If a function or member function name is used,
2185+
the appropriate function and the validity of the call are determined
2186+
according to the rules in~\ref{over.match}. If the selected
21852187
function is non-virtual, or if the \grammarterm{id-expression} in the class
21862188
member access expression is a \grammarterm{qualified-id}, that function is
21872189
called. Otherwise, its final overrider\iref{class.virtual} in the dynamic type
@@ -2212,6 +2214,12 @@
22122214
\indextext{type!incomplete}%
22132215
This return type shall be an object type, a reference type or \cv{}~\tcode{void}.
22142216

2217+
\pnum
2218+
Calling a function through an
2219+
expression whose function type is different
2220+
from the function type of the called function's
2221+
definition results in undefined behavior\iref{dcl.link}.
2222+
22152223
\pnum
22162224
\indextext{function argument|see{argument}}%
22172225
\indextext{function parameter|see{parameter}}%

source/overloading.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
cannot be overloaded.
1919

2020
\pnum
21-
When an overloaded function name is used in a call, which overloaded function
22-
declaration is being referenced is determined by comparing the types
21+
When a function name is used in a call, which function
22+
declaration is being referenced and the validity of the call
23+
are determined by comparing the types
2324
of the arguments at the point of use with the types of the parameters
24-
in the overloaded declarations that are visible at the point of use.
25+
in the declarations that are visible at the point of use.
2526
This function selection process is called
2627
\defn{overload resolution} and is defined in~\ref{over.match}.
2728
\begin{example}

source/templates.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8629,9 +8629,8 @@
86298629

86308630
\pnum
86318631
\indextext{overloading!resolution!function template}%
8632-
A function template can be overloaded either by (non-template) functions of its
8633-
name or by (other) function templates of the same name.
8634-
When a call to that name is written (explicitly, or implicitly using the
8632+
When a call to the name of a function or function template
8633+
is written (explicitly, or implicitly using the
86358634
operator notation), template argument deduction\iref{temp.deduct}
86368635
and checking of any explicit template arguments\iref{temp.arg} are performed
86378636
for each function template to find the template argument values (if any) that

0 commit comments

Comments
 (0)