The function declarations found by name lookup (
[basic.lookup]) constitute the
set of candidate functions
. Because of the rules for name lookup, the set of candidate functions
consists either entirely of non-member functions or entirely of
member functions of some class
T. Otherwise, the argument list is the
expression-list
in the call augmented by the addition of an implied object
argument as in a qualified function call
. If the current class is, or is derived from,
T, and the keyword
this (
[expr.prim.this]) refers to it,
then the implied object argument is
(*this). Otherwise,
a contrived object of type
T
becomes the implied object argument;
if overload resolution selects a non-static member function,
the call is ill-formed
. [
Example 1:
struct C {
void a();
void b() {
a();
}
void c(this const C&);
void c() &;
static void c(int = 0);
void d() {
c();
(C::c)();
(&(C::c))();
(&C::c)(C{});
(&C::c)(*this);
(&C::c)();
}
void f(this const C&);
void g() const {
f();
f(*this);
this->f();
}
static void h() {
f();
f(C{});
C{}.f();
}
void k(this int);
operator int() const;
void m(this const C& c) {
c.k();
}
};
—
end example]