From patchwork Wed Apr 13 14:23:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 91015 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1049FB6FD4 for ; Thu, 14 Apr 2011 00:24:06 +1000 (EST) Received: (qmail 5628 invoked by alias); 13 Apr 2011 14:24:03 -0000 Received: (qmail 5616 invoked by uid 22791); 13 Apr 2011 14:24:01 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Apr 2011 14:23:52 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3DENqCq020692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Apr 2011 10:23:52 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3DENpmB024017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Apr 2011 10:23:51 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id p3DENo9D005258; Wed, 13 Apr 2011 16:23:50 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p3DENoE5004968; Wed, 13 Apr 2011 16:23:50 +0200 Date: Wed, 13 Apr 2011 16:23:50 +0200 From: Jakub Jelinek To: Jason Merrill Cc: Dodji Seketeli , GCC Patches Subject: Re: [PATCH] PR c++/48574 Message-ID: <20110413142350.GK17079@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <4DA5B075.1040704@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4DA5B075.1040704@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Wed, Apr 13, 2011 at 10:17:25AM -0400, Jason Merrill wrote: > On 04/13/2011 09:40 AM, Dodji Seketeli wrote: > >+ if (type_dependent_expression_p (DECL_INITIAL (instance))) > >+ { > >+ /* The initializer is type dependent so we cannot > >+ determine the dynamic type of this reference. */ > >+ if (nonnull) > >+ *nonnull = 0; > >+ return NULL_TREE; > >+ } > > *nonnull should still be true in this case; even if we don't know > what the reference refers to, we can still assume that it refers to > something. Otherwise OK. Then would be shorter, after that if it returns NULL_TREE. Jakub --- gcc/cp/class.c.jj 2011-04-12 19:43:49.000000000 +0200 +++ gcc/cp/class.c 2011-04-13 15:23:07.463670993 +0200 @@ -5939,6 +5939,7 @@ fixed_type_or_null (tree instance, int * itself. */ if (TREE_CODE (instance) == VAR_DECL && DECL_INITIAL (instance) + && !type_dependent_expression_p (DECL_INITIAL (instance)) && !htab_find (ht, instance)) { tree type;