From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29438 invoked by alias); 17 Sep 2004 16:30:03 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 29430 invoked from network); 17 Sep 2004 16:30:02 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.10) by sourceware.org with SMTP; 17 Sep 2004 16:30:02 -0000 Received: (qmail 25782 invoked from network); 17 Sep 2004 16:30:02 -0000 Received: from 82-32-50-9.cable.ubr07.azte.blueyonder.co.uk (HELO codesourcery.com) (nathan@82.32.50.9) by mail.codesourcery.com with RC4-MD5 encrypted SMTP; 17 Sep 2004 16:30:02 -0000 Message-ID: <414B1102.70205@codesourcery.com> Date: Fri, 17 Sep 2004 16:44:00 -0000 From: Nathan Sidwell Organization: Codesourcery LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 MIME-Version: 1.0 To: Alexandre Oliva CC: Alan Lehotsky , gcc@gcc.gnu.org Subject: Re: template function specialization trouble - probably a user error, but... References: <72CB8FCC-089E-11D9-B0E1-003065D56982@alum.mit.edu> <414AD810.1000501@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-09/txt/msg01074.txt.bz2 Alexandre Oliva wrote: > On Sep 17, 2004, Nathan Sidwell wrote: > > >>Alan Lehotsky wrote: > > >>>template<> inline T::basetype MASK(int width) .... > > >>It looks like you're trying to partially specialize a function >>template. There is no such thing. > > > This is not partial specialization, it's explicit specialization, > which works for both class and function templates. What he's missing > is a `typename' before T::basetype, such that GCC knows it's a > template-dependent type. If its a specialization, then it can't have a dependent type. Adding typename won't fix things, as there's no 'T' in scope in the first place. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk