From patchwork Wed Jun 8 21:35:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 99562 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 46E48B6FDC for ; Thu, 9 Jun 2011 07:35:56 +1000 (EST) Received: (qmail 31405 invoked by alias); 8 Jun 2011 21:35:54 -0000 Received: (qmail 31271 invoked by uid 22791); 8 Jun 2011 21:35:54 -0000 X-SWARE-Spam-Status: No, hits=-6.4 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, 08 Jun 2011 21:35:40 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p58LZe00011332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 8 Jun 2011 17:35:40 -0400 Received: from [127.0.0.1] ([10.3.113.14]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p58LZePK020738 for ; Wed, 8 Jun 2011 17:35:40 -0400 Message-ID: <4DEFEB2B.5080403@redhat.com> Date: Wed, 08 Jun 2011 17:35:39 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for C++0x failure on template/dtor6.C 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 Running the testsuite in C++0x mode caught this issue. Tested x86_64-pc-linux-gnu, applied to trunk. commit b531be395b85f7872c51e79ffb5db9a30a2a4f66 Author: Jason Merrill Date: Thu Jun 2 14:35:59 2011 -0400 * semantics.c (potential_constant_expression_1): Handle destructor call. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ebca840..53e5993 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -7763,6 +7763,12 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) want_rval = true; goto binary; + case BIT_NOT_EXPR: + /* A destructor. */ + if (TYPE_P (TREE_OPERAND (t, 0))) + return true; + /* else fall through. */ + case REALPART_EXPR: case IMAGPART_EXPR: case CONJ_EXPR: @@ -7771,7 +7777,6 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) case FLOAT_EXPR: case NEGATE_EXPR: case ABS_EXPR: - case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: case FIXED_CONVERT_EXPR: case UNARY_PLUS_EXPR: