This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


>>>>> «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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]