From patchwork Sun Apr 15 17:03:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 152673 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 3A532B6FEA for ; Mon, 16 Apr 2012 03:03:44 +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=1335114224; 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=aEYRLGe SB8yj8e/59Iu3rA3Q/sA=; b=AQJFH7XlTGeQHOX9N3gRRF97lReKITuVaBntgEL FpOWgrACJk1mjSw4UpyJQJr2pcW97xhCn1ZqSricsFrf3rTMAs9c6b1gpkIrqgL+ 4Uh604q0vmpsTpr0tUzIvPRaUcmmStwIT/0sDYwOijgESWWcR2y809OnRvk1jouD /Uao= 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=fEIpG5LD3qSrpEFXIxrgBuJCMp1JBlX2+qPU639v/4RMNBdET6RPFTGUXrBsnk xFxlifuZgq/y+w9cei9QoOOL2Nfo7tFdYBARx6djPReBpONRnOtAjiisPPqCBHII kKbEx2TpVZa0r5rAx0TKFDztc1mhxbSJVrDTWApaAbQRc=; Received: (qmail 30930 invoked by alias); 15 Apr 2012 17:03:40 -0000 Received: (qmail 30920 invoked by uid 22791); 15 Apr 2012 17:03:40 -0000 X-SWARE-Spam-Status: No, hits=-6.2 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; Sun, 15 Apr 2012 17:03:27 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3FH3Rhl001484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 15 Apr 2012 13:03:27 -0400 Received: from [10.3.113.15] ([10.3.113.15]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3FH3Q3V028967 for ; Sun, 15 Apr 2012 13:03:27 -0400 Message-ID: <4F8AFF5E.7080805@redhat.com> Date: Sun, 15 Apr 2012 13:03:26 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/52706 (nullptr_t mangling) 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 were incorrectly treating nullptr_t as a substitutable type. Tested x86_64-pc-linux-gnu, applying to trunk. commit d13e197a238f2cbcca283e8d2332ea75af00b297 Author: Jason Merrill Date: Fri Apr 13 17:34:31 2012 -0400 PR c++/52706 * mangle.c (write_type): nullptr_t is a builtin type. diff --git a/gcc/common.opt b/gcc/common.opt index 39f1679..ee0c66a 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -788,6 +788,8 @@ Driver Undocumented ; argument. ; First selectable in G++ 4.7. ; +; 7: The version of the ABI that treats nullptr_t as a builtin type. +; First selectable in G++ 4.8. ; Additional positive integers will be assigned as new versions of ; the ABI become the default version of the ABI. fabi-version= diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 1536828..d00df1f 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2023,6 +2023,8 @@ write_type (tree type) case NULLPTR_TYPE: write_string ("Dn"); + if (abi_version_at_least (7)) + ++is_builtin_type; break; case TYPEOF_TYPE: diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr27.C b/gcc/testsuite/g++.dg/cpp0x/nullptr27.C new file mode 100644 index 0000000..1b86868 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr27.C @@ -0,0 +1,8 @@ +// PR c++/52706 +// { dg-options "-std=c++11 -fabi-version=0" } +// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } } + +template +int f(T); + +int i2 = f(nullptr); // 17