From patchwork Mon Jul 9 14:09:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 169851 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 3C42F2C007F for ; Tue, 10 Jul 2012 00:09:31 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1342447772; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=7mYDOw/ k/y6NZNd1XOFiXnrQzqw=; b=jvpx11H4olBfQwalhRjhW5kOs2zvqtdd08NDJGx g4AHGay/YTXnevsHApTWITRifX0ECjJuhNYOzCag9DaTOi0Utngu8qLRdno6rfNE qO5BunVwVkaeP9mpTs+mUCzTROy9RiQk5FMpdopUw77rne6Wn0d9sUW2MfCciqrF qf5A= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Gzfsyo4c4uCZNyz3rL3R/Vre51wqoPlxtk9SvpFCz+70nOFvYdPue6SxIr+84b Ge+oyZURVvWpD3zU5KxuWPtHsqXAQmKRkPYXOiXD9EVUnV6YR8upmEPfASyey+fY 4EuxcfdDKXjNSZh0GHLwrJEI0blKmHHiOHV9Ka2DCYWD8=; Received: (qmail 24667 invoked by alias); 9 Jul 2012 14:09:26 -0000 Received: (qmail 24651 invoked by uid 22791); 9 Jul 2012 14:09:24 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, 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; Mon, 09 Jul 2012 14:09:09 +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 q69E98Ru026067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Jul 2012 10:09:08 -0400 Received: from [10.3.113.116] (ovpn-113-116.phx2.redhat.com [10.3.113.116]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q69E97qd009080 for ; Mon, 9 Jul 2012 10:09:08 -0400 Message-ID: <4FFAE601.2090503@redhat.com> Date: Mon, 09 Jul 2012 16:09:05 +0200 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/53882 (ICE with bind, nullptr and -O) 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 We also need to handle NULLPTR_TYPE in type_contains_placeholder. While I was at it, I added a NULLPTR_TYPE case to type_hash_eq just in case. Tested x86_64-pc-linux-gnu, applying to trunk and 4.7. commit 05eb87b7123c9161268a0ef89b160c489a3d4935 Author: Jason Merrill Date: Mon Jul 9 15:39:06 2012 +0200 PR c++/53882 * tree.c (type_contains_placeholder_1): Handle NULLPTR_TYPE. (type_hash_eq): Likewise. diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr29.C b/gcc/testsuite/g++.dg/cpp0x/nullptr29.C new file mode 100644 index 0000000..a8e35a9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr29.C @@ -0,0 +1,4 @@ +// PR c++/53882 +// { dg-options "-std=gnu++11 -O" } + +void f(decltype(nullptr) &__restrict np) { } diff --git a/gcc/tree.c b/gcc/tree.c index 9be0c9a..f92f070 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2980,6 +2980,7 @@ type_contains_placeholder_1 (const_tree type) case METHOD_TYPE: case FUNCTION_TYPE: case VECTOR_TYPE: + case NULLPTR_TYPE: return false; case INTEGER_TYPE: @@ -6188,6 +6189,7 @@ type_hash_eq (const void *va, const void *vb) case COMPLEX_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: + case NULLPTR_TYPE: return 1; case VECTOR_TYPE: