From patchwork Wed Mar 30 19:50:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 88955 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 F2A42B6EF0 for ; Thu, 31 Mar 2011 06:50:20 +1100 (EST) Received: (qmail 26523 invoked by alias); 30 Mar 2011 19:50:17 -0000 Received: (qmail 26496 invoked by uid 22791); 30 Mar 2011 19:50:16 -0000 X-SWARE-Spam-Status: No, hits=-6.3 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, 30 Mar 2011 19:50:05 +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 p2UJo4XK017136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Mar 2011 15:50:04 -0400 Received: from [127.0.0.1] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2UJo3vB028860 for ; Wed, 30 Mar 2011 15:50:04 -0400 Message-ID: <4D93896A.7010809@redhat.com> Date: Wed, 30 Mar 2011 15:50:02 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/48369 (ICE with isnan) 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 A couple of missed cases. Tested x86_64-pc-linux-gnu, applying to trunk and 4.6. commit cea17025eb232f3931ce34e16dedff7fd42d2478 Author: Jason Merrill Date: Wed Mar 30 15:17:27 2011 -0400 PR c++/48369 * semantics.c (potential_constant_expression_1): Handle UNORDERED_EXPR and ORDERED_EXPR. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index b88e190..48dd4ee 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -7741,6 +7741,8 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) case BIT_XOR_EXPR: case BIT_AND_EXPR: case TRUTH_XOR_EXPR: + case UNORDERED_EXPR: + case ORDERED_EXPR: case UNLT_EXPR: case UNLE_EXPR: case UNGT_EXPR: diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C b/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C new file mode 100644 index 0000000..40d07e5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C @@ -0,0 +1,9 @@ +// PR c++/48369 +// { dg-options -std=gnu++0x } + +extern "C" int isnan (double); + +void f(double d) +{ + bool b = isnan(d); +}