From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22332 invoked by alias); 19 Mar 2003 09: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 22288 invoked by uid 71); 19 Mar 2003 09:36:00 -0000 Resent-Date: 19 Mar 2003 09:36:00 -0000 Resent-Message-ID: <20030319093600.22287.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, lalle@sics.se Received: (qmail 16277 invoked by uid 48); 19 Mar 2003 09:26:58 -0000 Message-Id: <20030319092658.16275.qmail@sources.redhat.com> Date: Wed, 19 Mar 2003 09:36:00 -0000 From: lalle@sics.se Reply-To: lalle@sics.se To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10147: Confusing error message for invalid template function argument X-SW-Source: 2003-03/txt/msg01256.txt.bz2 List-Id: >Number: 10147 >Category: c++ >Synopsis: Confusing error message for invalid template function argument >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Mar 19 09:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Lars Albertsson >Release: 3.2.2 >Organization: >Environment: snaga:tmp> uname -a Linux snaga.sics.se 2.4.19 #7 Fri Nov 29 15:22:22 CET 2002 i686 i686 i386 GNU/Linux snaga:tmp> cat /etc/redhat-release Red Hat Linux release 8.0 (Psyche) >Description: snaga:tmp> cat bug.ii namespace N1 { typedef long A; struct B { virtual A a() const; }; struct D : public B { A a() const; }; } N1::D d(); namespace N2 { struct A {}; template < class T > T tf(const T &) { return T(); } void f(const N1::B & b) { tf< A >(b.a()); } } void f2() { N2::f(d()); } snaga:tmp> /opt/gcc-3.2.2/bin/g++ -c bug.ii bug.ii: In function `void N2::f(const N1::B&)': bug.ii:32: could not convert `(**(+b)->N1::B::_vptr.B)((+b))' to `const N2::A&' bug.ii:26: in passing argument 1 of `T N2::tf(const T&) [with T = N2::A]' snaga:tmp> /opt/gcc-3.2.2/bin/g++ -v Reading specs from /opt/gcc-3.2.2/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs Configured with: /tmp/post_install/gcc-3.2.2/configure --enable-languages=c,c++ --prefix=/opt/gcc-3.2.2 Thread model: posix gcc version 3.2.2 >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: