From patchwork Mon Apr 29 09:05:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 240344 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 2BAC52C00A7 for ; Mon, 29 Apr 2013 19:05:25 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=rhAQr+598Pm2yu9cAiBhky0OLbji6AILgCl+LbVBnGe 0bnfT+V9S3HDkepjv1qsAZ0umKJaebsuj2BKfJisVZOkyl3w9pxROfLo0vPtua4c 30j7lyKjdlPc6PBGGmIDP31yKjFEq8Zj1QtMa9KKff5SnH/RGI/oUN3hkolCsRPI = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=EoI46fcITprev1Vmv8Sj6xTAZcM=; b=QM4t4hqPo3/nfR1it PuYwZryrrb6gkWFb9HuSdqLR7UYNLq0GjyaIIPd6VhSRNSm72Y4aZy1Keywm0XE7 aAguxIMHrdDpt/nGDFBpU7wtpkrvvGoeB1F8bvH7PkwVTIeMu7HX7f6H56XLZq9w oTHaDS0w3Zb8Xldw5140GnbrsE= Received: (qmail 9023 invoked by alias); 29 Apr 2013 09:05:18 -0000 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 Received: (qmail 9003 invoked by uid 89); 29 Apr 2013 09:05:18 -0000 X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Apr 2013 09:05:17 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r3T95Efw003612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Apr 2013 09:05:15 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3T95Em8007768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 29 Apr 2013 09:05:14 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3T95EtQ007762; Mon, 29 Apr 2013 09:05:14 GMT Received: from poldo4.casa (/79.36.30.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 29 Apr 2013 02:05:13 -0700 Message-ID: <517E37C7.7000001@oracle.com> Date: Mon, 29 Apr 2013 11:05:11 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch/RFC] PR 57092 X-Virus-Found: No Hi, in this 4.8/4.9 Regression, finish_decltype_type doesn't handle ADDR_EXPR. In 4.7, finish_decltype_type deals with a TEMPLATE_PARM_INDEX and the testcase compiles fine, but it's quite easy - see c++/52282 - to trigger the same ICE there too (it would be nice to make progress on the latter too). The patchlet below passes testing, not sure whether there is something deeper about this issue. Thanks, Paolo. ///////////////// Index: cp/semantics.c =================================================================== --- cp/semantics.c (revision 198381) +++ cp/semantics.c (working copy) @@ -5389,6 +5389,7 @@ finish_decltype_type (tree expr, bool id_expressio case PARM_DECL: case RESULT_DECL: case TEMPLATE_PARM_INDEX: + case ADDR_EXPR: expr = mark_type_use (expr); type = TREE_TYPE (expr); break; Index: testsuite/g++.dg/cpp0x/decltype53.C =================================================================== --- testsuite/g++.dg/cpp0x/decltype53.C (revision 0) +++ testsuite/g++.dg/cpp0x/decltype53.C (working copy) @@ -0,0 +1,11 @@ +// PR c++/57092 +// { dg-do compile { target c++11 } } + +template +class B { + decltype(F) v; +}; + +void foo(int) {} + +B o;