From patchwork Fri Jul 16 14:03:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 59106 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 D96C2B6F07 for ; Sat, 17 Jul 2010 00:03:14 +1000 (EST) Received: (qmail 15402 invoked by alias); 16 Jul 2010 14:03:12 -0000 Received: (qmail 15311 invoked by uid 22791); 16 Jul 2010 14:03:11 -0000 X-SWARE-Spam-Status: No, hits=-6.0 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; Fri, 16 Jul 2010 14:03:06 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6GE32hJ030451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Jul 2010 10:03:02 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6GE31qH024331; Fri, 16 Jul 2010 10:03:02 -0400 Message-ID: <4C406694.5060005@redhat.com> Date: Fri, 16 Jul 2010 10:03:00 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100712 Lightning/1.0b1 Shredder/3.0.7pre MIME-Version: 1.0 To: Gabriel Dos Reis CC: Gabriel Dos Reis , bkoz@redhat.com, gcc-patches@gcc.gnu.org Subject: Re: git repository for constexpr (was Re: C++ PATCH for constexpr) References: <87bpiosq4g.fsf@gauss.cs.tamu.edu> <4B121000.5080502@redhat.com> <87ljhpi1y2.fsf@gauss.cs.tamu.edu> <4B1367A6.9020204@redhat.com> <87eing1lt6.fsf@gauss.cs.tamu.edu> <4B142947.9010604@redhat.com> <873a3vbkjn.fsf@gauss.cs.tamu.edu> <4B16F2BA.8090604@redhat.com> <206fcf960912021510o2af78178i961493f640dfbc46@mail.gmail.com> <4B44B793.4080306@redhat.com> <4B686DFF.8060906@redhat.com> <871vh34hkp.fsf@gauss.cs.tamu.edu> <4B687551.90204@redhat.com> <87mxzra1bd.fsf@gauss.cs.tamu.edu> <4BE37770.2030809@redhat.com> <4C3DF588.9020008@redhat.com> In-Reply-To: <4C3DF588.9020008@redhat.com> 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 07/14/2010 01:36 PM, Jason Merrill wrote: > On 05/06/2010 10:14 PM, Jason Merrill wrote: >> I've set up a git repository for constexpr work: the web interface is at >> >> http://repo.or.cz/w/official-gcc/constexpr.git > > It occurred to me that it wasn't really necessary to use a third-party > site; I have now added a "constexpr" branch to the official git mirror > (http://gcc.gnu.org/wiki/GitMirror). I've now updated this branch to current trunk, with no regressions. I needed to apply this patch to avoid some regressions on initlist tests. commit af4de5b1df1cb3ffb8148fcb7b8f0258ee5e717f Author: Jason Merrill Date: Fri Jul 16 00:47:54 2010 -0400 fix initlist tests diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 5d64075..c6140dc 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5930,7 +5930,9 @@ implicit_dereference_p (tree t) static bool implicit_address_p (tree t) { - if (TREE_CODE (t) == NOP_EXPR) + if (TREE_CODE (t) != NOP_EXPR + || TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE) + return false; switch (TREE_CODE (TREE_OPERAND (t, 0))) { case ADDR_EXPR: @@ -5947,7 +5949,6 @@ implicit_address_p (tree t) default: return false; } - return false; } @@ -5984,7 +5985,8 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t) return cxx_eval_constant_expression (call, TREE_OPERAND (t, 0)); case ADDR_EXPR: - if (TREE_STATIC (TREE_OPERAND (t, 0))) + if (TREE_STATIC (TREE_OPERAND (t, 0)) + || DECL_EXTERNAL (TREE_OPERAND (t, 0))) return t; error ("address of object %qE with non-static storage is " " not a constant expression", t); @@ -6097,10 +6099,9 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t) } return cxx_eval_constant_expression (call, t); } - t = cp_convert + return cp_convert (TREE_TYPE (t), cxx_eval_constant_expression (call, TREE_OPERAND (t, 0))); - return cxx_eval_constant_expression (call, t); } case CONVERT_EXPR: