From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3920 invoked by alias); 13 May 2003 21:19:59 -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 16774 invoked by uid 71); 13 May 2003 21:16:03 -0000 Resent-Date: 13 May 2003 21:16:03 -0000 Resent-Message-ID: <20030513211603.16772.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, gtg833i@mail.gatech.edu Received: (qmail 31472 invoked by uid 48); 13 May 2003 21:07:33 -0000 Message-Id: <20030513210733.31463.qmail@sources.redhat.com> Date: Tue, 13 May 2003 21:19:00 -0000 From: gtg833i@mail.gatech.edu Reply-To: gtg833i@mail.gatech.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10773: template method in base class not resolved X-SW-Source: 2003-05/txt/msg01520.txt.bz2 List-Id: >Number: 10773 >Category: c++ >Synopsis: template method in base class not resolved >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue May 13 21:16:02 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Enrique Robledo Arnuncio >Release: g++ (GCC) 3.2.3 >Organization: >Environment: debian GNU/Linux, unstable (sid) intel i386 >Description: A template method in a base class can not be resolved on the concrete class when the concrete class has a method with the same name. This may be related to the missing feature mentioned in the bug reporting instructions, related to two-stages template lookup, but I have no way to know. The following code reproduces the problem: -------------------------------------- class arg {}; struct A { template int f(T a) { return 10;} }; struct B : public A { // Commenting out next lines "uncovers" the template method in the base // class, and the program compiles and works. int f(int a); }; int main() { B b; arg a; // Last statement gives this error: // hidden_template_member.cc: In function `int main()': // hidden_template_member.cc:27: error: no matching function for call to `B::f(arg&)' // hidden_template_member.cc:14: note: candidates are: int B::f(int) return b.f(a); } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: