From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14181 invoked by alias); 11 Mar 2008 19:50:56 -0000 Received: (qmail 14173 invoked by uid 22791); 11 Mar 2008 19:50:55 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Mar 2008 19:50:33 +0000 Received: (qmail 6919 invoked from network); 11 Mar 2008 19:50:31 -0000 Received: from unknown (HELO ?192.168.0.2?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Mar 2008 19:50:31 -0000 Message-ID: <47D6DC29.6020301@codesourcery.com> Date: Tue, 11 Mar 2008 19:50:00 -0000 From: Mark Mitchell User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Paolo Carlini CC: Gcc Patch List Subject: Re: Renaming IS_AGGR_TYPE & co References: <47D1720D.5010206@suse.de> <47D453DB.1070802@codesourcery.com> <47D5172B.9010007@suse.de> <47D54E81.7020206@codesourcery.com> <47D55DFB.7070704@suse.de> <47D58770.3080000@codesourcery.com> <47D58C01.6040004@suse.de> <47D599E7.1010608@suse.de> In-Reply-To: <47D599E7.1010608@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00704.txt.bz2 Paolo Carlini wrote: > Some additional details... >> You are right, in the sense that actually the TYPENAME_TYPE comes from a >> different caller, finish_base_specifier (in semantics.c). The below is >> is the complete call stack. Then, would it make sense to change somehow >> finish_base_specifier to allow for TYPENAME_TYPEs? >> > Doing, in finish_base_specifier, something like: > > - else if (! is_aggr_type (base, 1)) > + else if (TREE_CODE (base) != TYPENAME_TYPE > + && TREE_CODE (base) != TEMPLATE_TYPE_PARM > + && TREE_CODE (base) != BOUND_TEMPLATE_TEMPLATE_PARM > + && ! is_class_type (base, 1)) > result = NULL_TREE; > > allows the testsuite to pass... I think that in this case you want MAYBE_CLASS_TYPE_P. Here, the compiler is checking to see if the type is a valid base class type. If it's a template type parameter, it *might* be a class type -- we just don't know yet. So, we want to accept it. Thanks, -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713