This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Conversion templates (Was: ICE980331 *2 with egcs-2.91.47 19980710)
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: Conversion templates (Was: ICE980331 *2 with egcs-2.91.47 19980710)
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at dptmaths dot ens-cachan dot fr>
- Date: Tue, 14 Jul 1998 22:59:35 +0200 (MET DST)
- Cc: Franz dot Sirl-kernel at lauterbach dot com, egcs-bugs at cygnus dot com
- References: <98071221082700.14209@ns1102.munich.netsurf.de><199807140813.KAA01899@mira.isdn.cs.tu-berlin.de>
>>>>> «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