From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31576 invoked by alias); 22 Jan 2003 10: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 31562 invoked by uid 71); 22 Jan 2003 10:56:00 -0000 Date: Wed, 22 Jan 2003 10:56:00 -0000 Message-ID: <20030122105600.31561.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Vincent PICAUD" Subject: Re: c++/9380: nested template problem for methods without argument : parsing error Reply-To: "Vincent PICAUD" X-SW-Source: 2003-01/txt/msg01193.txt.bz2 List-Id: The following reply was made to PR c++/9380; it has been noted by GNATS. From: "Vincent PICAUD" To: , , , , , Cc: Subject: Re: c++/9380: nested template problem for methods without argument : parsing error Date: Wed, 22 Jan 2003 11:51:09 +0100 (MET) Thank you very much for your valuable explanations... I apologise for my mistake... I didn't know this C++ syntax : "a.template= how_many();" Now all work fine and thanks to you I can continue to develop my code. Regards, -- Vincent Picaud. >Messsage du 21/01/2003 14:15 >De : , , , , , >A : , , , >Copie =E0 : >Objet : Re: c++/9380: nested template problem for methods without argume= nt : parsing error > > Synopsis: nested template problem for methods without argument : parsin= g error > > State-Changed-From-To: open->closed > State-Changed-By: lerdsuwa > State-Changed-When: Tue Jan 21 14:15:05 2003 > State-Changed-Why: > Not a bug. Your code inside 'foo_2': > a.how_many(); > 'a' depends on the template parameter 'dim' so the compiler > doesn't know if 'how_many' is a variable, a type, or a > template. For example, you can declare a specialization > template<> class A { int how_many; } > Then 'A.how_many' is a template function but > 'A.how_many' is a variable. > > When you are referring to a template when the context is > template parameter dependent, you need the 'template' > keyword as in: > a.template how_many(); > The same applies to the example in the Fix section: > a.template how_many(id_foo()); > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl=3Fcmd=3Dview%20audit-trail&datab= ase=3Dgcc&pr=3D9380 >