From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31634 invoked by alias); 29 Apr 2003 10:46:02 -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 31620 invoked by uid 71); 29 Apr 2003 10:46:02 -0000 Date: Tue, 29 Apr 2003 10:46:00 -0000 Message-ID: <20030429104602.31619.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Giovanni Bajo" Subject: Re: c++/10527: Internal error during template compile Reply-To: "Giovanni Bajo" X-SW-Source: 2003-04/txt/msg01333.txt.bz2 List-Id: The following reply was made to PR c++/10527; it has been noted by GNATS. From: "Giovanni Bajo" To: , , , , , Cc: "Wolfgang Bangerth" Subject: Re: c++/10527: Internal error during template compile Date: Tue, 29 Apr 2003 12:45:06 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p r=10527 Confirmed. Reduced snippet is: ------------------------------------------------------------ template struct Foo {}; template void Foo::NON_EXISTENT(int* val = new int()) {} ------------------------------------------------------------ pr10527.cpp:7: error: no ` Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, This is ice-on-illegal-code, 3.3/3.4 regression with respect to 2.95 where the same code shows a correct error message. Note that if Foo is a normal class, the ICE disappears but the error message is _ugly_: ------------------------------------------------------------ struct Foo {}; void Foo::NON_EXISTENT(int* val = new int()) {} ------------------------------------------------------------ pr10527.cpp:5: error: no `void Foo::NON_EXISTENT(int* = (operator new(unsigned int)(4), ((true, (((*) 0), ( false))), )))' member function declared in class `Foo' For the original poster, your code is illegal for several reasons. First, the parameter list of your makeQueryHandler() function at definition time does not match the parameter list at declaration time. Then, if you want to define a template member function of a template class outside the class definition, the syntax you must use is the following: template struct Foo { template void func(..........); }; template template void Foo::func(.......) { ..... } Hope this helps Giovanni Bajo