From mboxrd@z Thu Jan 1 00:00:00 1970 From: Axel.Zeuner@systor.com To: gcc-gnats@gcc.gnu.org Subject: c++/3396: template conversion operator Date: Mon, 25 Jun 2001 00:56:00 -0000 Message-id: <20010625075335.15651.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg01031.html List-Id: >Number: 3396 >Category: c++ >Synopsis: template conversion operator >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Jun 25 00:56:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Axel Zeuner >Release: 2.95.2, 3.0-release, 3.0.1 (prerelease) >Organization: >Environment: Solaris 2.6, Linux >Description: Conversion operators of templates classes to typenames typedefed in the template class work only in the body. >How-To-Repeat: Compile the test program attached. >Fix: Implement conversion operators in templates in the class body. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="main.cpp" Content-Disposition: inline; filename="main.cpp" template class X { public: typedef T* XY; operator XY(); }; template X::operator X::XY() { return XY(0); } int main() { X p; int* pp=p; int rc=0; if ( pp!= 0) { rc=1; } return rc; }