From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20976 invoked by alias); 27 Jan 2003 19:26: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 20921 invoked by uid 71); 27 Jan 2003 19:26:00 -0000 Resent-Date: 27 Jan 2003 19:26:00 -0000 Resent-Message-ID: <20030127192600.20919.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, oliver.schoenborn@utoronto.ca Received: (qmail 16043 invoked by uid 48); 27 Jan 2003 19:18:03 -0000 Message-Id: <20030127191803.16042.qmail@sources.redhat.com> Date: Mon, 27 Jan 2003 19:26:00 -0000 From: oliver.schoenborn@utoronto.ca Reply-To: oliver.schoenborn@utoronto.ca To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9460: parse error on template member function X-SW-Source: 2003-01/txt/msg01528.txt.bz2 List-Id: >Number: 9460 >Category: c++ >Synopsis: parse error on template member function >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Jan 27 19:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Oliver Schoenborn >Release: 3.2.2 on cygwin, 3.2 linux, 3.0.4 SGI >Organization: >Environment: Cygwin (latest), linux redhat 7.3, SGI Irix 6.5.13 >Description: struct Test { template void test(T*) {} }; template struct Foo { Test _state; int _i; void reset() { _state.test(&_i); // ok _state.test(&_i); // parse error here if... } // ... and only if following is not // same name as Test::test!!!! template void test2() {} }; int main() { Foo test; test.reset(); } >How-To-Repeat: Just try to compile the file with "g++ -c file.cc" >Fix: none except hack: add extra parameters to function so it can deduce template parameter Colleague has reported that these may work too (not tested rigorously): _state.template test(&_i); //avoids the error _state.Test::test(&_i); //avoids the error >Release-Note: >Audit-Trail: >Unformatted: