From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13385 invoked by alias); 11 Feb 2003 10:36: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 13367 invoked by uid 71); 11 Feb 2003 10:36:00 -0000 Resent-Date: 11 Feb 2003 10:36:00 -0000 Resent-Message-ID: <20030211103600.13365.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, maudouy@amadeus.net Received: (qmail 12290 invoked by uid 48); 11 Feb 2003 10:28:39 -0000 Message-Id: <20030211102839.12289.qmail@sources.redhat.com> Date: Tue, 11 Feb 2003 10:36:00 -0000 From: maudouy@amadeus.net Reply-To: maudouy@amadeus.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9660: use of template keyword to specify templated method cause ICE X-SW-Source: 2003-02/txt/msg00487.txt.bz2 List-Id: >Number: 9660 >Category: c++ >Synopsis: use of template keyword to specify templated method cause ICE >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Tue Feb 11 10:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: maudouy@amadeus.net >Release: gcc 3.0.1 >Organization: >Environment: HP-UX B.11.11 >Description: the use of "template" keyword for template specialisation appearing in a postfix expression (ISO 14882 14.2.4) is causing an internal compiler error. the attached file, compiled without options, reproduce the ICE. >How-To-Repeat: >Fix: an easy workaround is not to use the template keyword, it works in this case. but when using other compilers (like aCC on HP-UX) it is necessary. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="templateBug.cpp" Content-Disposition: inline; filename="templateBug.cpp" namespace TOTO { template ObjectType& create(FirstArgumentType & firstArg, SecondArgumentType & secondArg) { ObjectType & ref = *(new ObjectType(firstArg, secondArg)); return ref; } } namespace FOO { class A { public: int x_; int y_; A(int& x, int& y):x_(x),y_(y) {} }; class B { public: A& getA(int a, int b) { A& anA = TOTO::template create(a,b); return anA; } }; } int main() { FOO::B b; FOO::A& anA = b.getA(2,3); }