Conversion templates (Was: ICE980331 *2 with egcs-2.91.47 19980710)

Gabriel Dos Reis Gabriel.Dos-Reis@dptmaths.ens-cachan.fr
Tue Jul 14 14:00:00 GMT 1998


>>>>> «Martin», Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> wrote:

[...]

Martin> I believe Derived::operator int()const hides Base::operator
Martin> int<int>()const ([class.conv]/5, which does not mention const-ness of
Martin> this, for some reason). As a result, the Base operator is not a
Martin> candidate ([over.match.conv]/1).

Martin> So g++ selects the right candidate, but considers non-candidates, and
Martin> complains about that.

Martin> I'm not sure what the right fix is (does the standard really mean that
Martin> Derived::operator foo() could hide Base::operator foo()volatile?), and
Martin> I don't know how to fix that - I'd rather leave implicit conversion to
Martin> other people (hi Jason).

The FDIS does not consider cv-qualification in member name lookup
[10.2/2] so Derived::operator foo() hides Base::operator foo() cv.

-- Gaby



More information about the Gcc-bugs mailing list