From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25003 invoked by alias); 3 Feb 2003 16:56:00 -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 24975 invoked by uid 71); 3 Feb 2003 16:56:00 -0000 Resent-Date: 3 Feb 2003 16:56:00 -0000 Resent-Message-ID: <20030203165600.24974.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, nidoizo@yahoo.com Received: (qmail 32517 invoked by uid 48); 3 Feb 2003 16:46:51 -0000 Message-Id: <20030203164651.32516.qmail@sources.redhat.com> Date: Mon, 03 Feb 2003 16:56:00 -0000 From: nidoizo@yahoo.com Reply-To: nidoizo@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9545: Can't find definition when similar member functions templated and not-templated X-SW-Source: 2003-02/txt/msg00114.txt.bz2 List-Id: >Number: 9545 >Category: c++ >Synopsis: Can't find definition when similar member functions templated and not-templated >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Feb 03 16:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Nicolas Fleury >Release: g++-3.2 >Organization: >Environment: Red Hat Linux 8.0 >Description: The problem occurs when two similar member functions (static or not) in a class are defined, the only difference being that one is templated and the other is not. The code works fine if the definition of these member functions is put directly in the class definition. But if these functions are defined outside the class body, gcc reports an error: buggcc.cc:11: expected 2 levels of template parms for `static bool A::foo() ', got 1 buggcc.cc:15: redefinition of `static bool A::foo()' buggcc.cc:11: `static bool A::foo()' previously declared here buggcc.cc:15: no `static bool A::foo()' member function declared in class ` A' Example: template class A { public: static bool foo(); template static bool foo(); }; template bool A::foo() { return true; } template template bool A::foo() { return true; } >How-To-Repeat: Compile >Fix: >Release-Note: >Audit-Trail: >Unformatted: