From patchwork Wed Oct 2 09:38:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 279674 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 did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F3B22C00AA for ; Wed, 2 Oct 2013 19:38:47 +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=OKkIxb9DYLdhucuwkXcEmphb5hDeAeP0gO0L3CcDYPT jhMYhJ+ssOAl83XW453kkVtKqT0CA5BMQ051fs8nwHClMAuM4xnb68tVSZMU3uVi l+mNp9xu0iDG+qNvSTGFC3HRNNZgA8Xwm2rjgO0e9V1Jv10xoj/+GvRCxMf2dOCg = 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=ufp3g1cxk+kfJ1Nx/xgbRP7cbAs=; b=L0SPpw//fjxPo1fWO IzunGne2Y/ZEfT1lQJxXDxMWGuti+ILPQh0RWYyEElgHtoZ/qQcBa3694G3j4V13 G3Et0u3HJgF5wh4wRSpfv0qRzmcyP0hhAXHd/gy8xjz4vt/7lr2GTl4hKpWU9/Gr 9mSjdUmql1ioXd4W0aCAGChbFY= Received: (qmail 29858 invoked by alias); 2 Oct 2013 09:38:41 -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 29848 invoked by uid 89); 2 Oct 2013 09:38:40 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 02 Oct 2013 09:38:40 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_SOFTFAIL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: userp1040.oracle.com 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 r929carQ030670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Oct 2013 09:38:37 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 r929ca5W025117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Oct 2013 09:38:36 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r929cZ6a025112; Wed, 2 Oct 2013 09:38:36 GMT Received: from poldo4.casa (/79.52.193.155) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 02 Oct 2013 02:38:35 -0700 Message-ID: <524BE999.9000704@oracle.com> Date: Wed, 02 Oct 2013 11:38:33 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 58565 X-IsSubscribed: yes Hi, here, with -std=c++11 LABEL_EXPR is unhandled by potential_constant_expression_1 and we can't emit a meaningful diagnostic. It seems safe to just add it to the main switch, together with the existing LABEL_DECL. Tested x86_64-linux. Thanks, Paolo. ////////////////////// /cp 2013-10-02 Paolo Carlini PR c++/58565 * semantics.c (potential_constant_expression_1): Handle LABEL_EXPR. /testsuite 2013-10-02 Paolo Carlini PR c++/58565 * g++.dg/parse/crash64.C: New. Index: cp/semantics.c =================================================================== --- cp/semantics.c (revision 203101) +++ cp/semantics.c (working copy) @@ -8422,6 +8422,7 @@ potential_constant_expression_1 (tree t, bool want case OVERLOAD: case TEMPLATE_ID_EXPR: case LABEL_DECL: + case LABEL_EXPR: case CONST_DECL: case SIZEOF_EXPR: case ALIGNOF_EXPR: Index: testsuite/g++.dg/parse/crash64.C =================================================================== --- testsuite/g++.dg/parse/crash64.C (revision 0) +++ testsuite/g++.dg/parse/crash64.C (working copy) @@ -0,0 +1,7 @@ +// PR c++/58565 +// { dg-options "" } + +void foo() +{ + int i = ({ L: ; }); // { dg-error "void value not ignored" } +}