c++/2861

Amitabh A. Nene anene@cup.hp.com
Mon May 21 15:06:00 GMT 2001


The following reply was made to PR c++/2861; it has been noted by GNATS.

From: "Amitabh A. Nene" <anene@cup.hp.com>
To: lerdsuwa@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/2861
Date: Mon, 21 May 2001 14:55:18 -0700 (PDT)

 From what you said, g++ should permit the use of the template
 keyword in the code below. But g++ still ices. So "class" needs to be
 changed to "ices-on-legal-code"..
 
 
 namespace Foo
 {
     template<typename _T>
     void test() {        
     }
 }
 
 
 template<typename _T>
 void bar()
 {    
     Foo::template test<_T>(); // this is inside a function template and
                               // should be legal
 }
 
 
 int main()
 {
     bar<int>();
 }
 
 
 thanks
 -amit
 
 
 On 18 May 2001 lerdsuwa@gcc.gnu.org wrote:
 
 > Synopsis: Parser crashes while parsing a call a template function using the template keyword
 > 
 > State-Changed-From-To: open->analyzed
 > State-Changed-By: lerdsuwa
 > State-Changed-When: Fri May 18 05:30:27 2001
 > State-Changed-Why:
 >     Confirm as a bug.  The code is illegal however.  Recent
 >     resolution by the standard committee (DR #30) requires that
 >     'template' qualifier be only used inside class or function
 >     template.  Despite this, gcc should not ICE in the code.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2861&database=gcc
 > 
 



More information about the Gcc-prs mailing list