From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4591 invoked by alias); 18 May 2003 17:56: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 4537 invoked by uid 71); 18 May 2003 17:56:00 -0000 Resent-Date: 18 May 2003 17:56:00 -0000 Resent-Message-ID: <20030518175600.4536.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, have@ann.jussieu.fr Received: (qmail 15402 invoked by uid 48); 18 May 2003 17:47:50 -0000 Message-Id: <20030518174750.15401.qmail@sources.redhat.com> Date: Sun, 18 May 2003 17:56:00 -0000 From: have@ann.jussieu.fr Reply-To: have@ann.jussieu.fr To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10845: `template method` not matched in template class X-SW-Source: 2003-05/txt/msg02037.txt.bz2 List-Id: >Number: 10845 >Category: c++ >Synopsis: `template method` not matched in template class >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun May 18 17:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: have@ann.jussieu.fr >Release: g++-3.2, 3.3 >Organization: >Environment: Linux i686 >Description: error: no matching function for call to `A::f(int&, A::SubA&)'. In what follows, words written as _underscored_ mean that without any _underscored_ hypothesis, bug does not occur. Let us consider a method f (with _two_ templates arguments) of a _template_ class A. The first argument is given by a _template T1_. The second argument is given as a _template_ sub class of A (SubA) and the second template typename of f is given for matching L. Moreover, there exists (at least) another template method in A which has the same argument type than the second one of f. Then f cannot be found when it is called. >How-To-Repeat: Try to compile this code ---8<------------ template struct A { template struct SubA { }; template void f(T1 & t1, SubA & t2) { } template void g(SubA & suba) { } template void h(SubA & suba) { } }; int main(void) { int i; A a; A::SubA suba; a.f(i,suba); a.g(suba); a.h(suba); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: