From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18797 invoked by alias); 2 Mar 2003 01:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 18775 invoked by uid 71); 2 Mar 2003 01:36:00 -0000 Resent-Date: 2 Mar 2003 01:36:00 -0000 Resent-Message-ID: <20030302013600.18774.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, philippeb@videotron.ca Received: (qmail 18441 invoked by uid 48); 2 Mar 2003 01:34:12 -0000 Message-Id: <20030302013412.18440.qmail@sources.redhat.com> Date: Sun, 02 Mar 2003 01:36:00 -0000 From: philippeb@videotron.ca Reply-To: philippeb@videotron.ca To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9898: Template cast operator fo template class X-SW-Source: 2003-03/txt/msg00029.txt.bz2 List-Id: >Number: 9898 >Category: c++ >Synopsis: Template cast operator fo template class >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun Mar 02 01:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: gcc >Release: 3.0.4 >Organization: >Environment: Debian Linux 2.2.19 >Description: GCC cannot compile the following: #include using namespace std; template struct Wrapper { template operator Wrapper const & () { } }; inline void foo(Wrapper const &) { cout << __PRETTY_FUNCTION__ << endl; } int main() { foo(Wrapper()); } Ouputs: templatetemplate.cpp: In function `int main()': templatetemplate.cpp:25: could not convert `{}' to `const Wrapper&' templatetemplate.cpp:18: in passing argument 1 of `void foo(const Wrapper&)' >How-To-Repeat: >Fix: - Transform Wrapper<> into non-template class Wrapper. - Remove the reference (&) returned by the cast operator. - Overload the cast operator to return Wrapper const &. >Release-Note: >Audit-Trail: >Unformatted: