From mboxrd@z Thu Jan 1 00:00:00 1970 From: benko@sztaki.hu To: gcc-gnats@gcc.gnu.org Subject: c++/4137: conversion operator within template Date: Mon, 27 Aug 2001 07:06:00 -0000 Message-id: <20010827140346.19091.qmail@sourceware.cygnus.com> X-SW-Source: 2001-08/msg00676.html List-Id: >Number: 4137 >Category: c++ >Synopsis: conversion operator within template >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Aug 27 07:06:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Benko Pal >Release: 3.0.1 >Organization: >Environment: SuSE 7.1 >Description: I do not know whether this is a bug in the compiler or illegal code. The following program does not compile: template struct a { typedef int b; operator b(); }; template a::operator typename a::b() // omitting `typename' // makes no difference { return 0; } Workaround: template struct a { typedef int b; operator b() {return 0;} }; Without templates there is no problem: struct a { typedef int b; operator b(); }; a::operator a::b() { return 0; } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: