https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102609

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If we're right about that, then I agree that a warning would be useful for
classes that have no such implicit conversion from S to S*.

I think the warning would give a false positive in the case below, so a way to
disable it locally would be needed (e.g. via a diagnostic pragma).

struct S {
  int f(this S*); // warning: explicit object parameter of pointer type can
only match if an implicit conversion to S* exists
};

struct T : S {
  operator T*();
};

T t;
int i = t.f(); // derived class has the required conversion

Reply via email to