From patchwork Mon Apr 22 18:48:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 238628 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 CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8B8882C015D for ; Tue, 23 Apr 2013 04:49:00 +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:subject:references :in-reply-to:content-type; q=dns; s=default; b=v6ZPUjuPLye70UbKV oLB53nVUcpgjgcWG3qH7FeQv352S0NvcQQILpZd+OmTuJ75+OJm1V7brZgpOA3CW Q7xO/dN+Xovwz1Fv4pUB9M8k6Kr4FtQEYnfN+/B6YHwmCJSinIKXWgCszc0SYczh 9cfhWFYiS2+b8QY9u+4BzUJeO0= 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:subject:references :in-reply-to:content-type; s=default; bh=YoI8avyupRhccEVTf3vJUpE 3mII=; b=puKTPb6JWcB9to7FSDThJ8Sgre1QRUFR7TPBeTq370Gg24S8v35nuLT zdZsvTq5mELoTUjL7Xb0gJwATNQfIUVfcfbMq07whOcexDEq2e55jqQD4YbzLNv+ HotIQZByPd0zWIkHuaCNNGxijq/r8rFySLld4hS6ZPK+AWcAAK0A= Received: (qmail 18853 invoked by alias); 22 Apr 2013 18:48:54 -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 18842 invoked by uid 89); 22 Apr 2013 18:48:53 -0000 X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 22 Apr 2013 18:48:53 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3MImpgH022904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Apr 2013 14:48:51 -0400 Received: from [10.36.116.23] (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3MImnRj012798 for ; Mon, 22 Apr 2013 14:48:50 -0400 Message-ID: <51758611.5000505@redhat.com> Date: Mon, 22 Apr 2013 14:48:49 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:22.0) Gecko/20100101 Thunderbird/22.0a2 MIME-Version: 1.0 To: gcc-patches List Subject: Re: C++ PATCH to implement N3582 changes to proposed C++14 return type deduction References: <5155F0B1.7050003@redhat.com> In-Reply-To: <5155F0B1.7050003@redhat.com> X-Virus-Found: No On 03/29/2013 03:51 PM, Jason Merrill wrote: > I've updated my proposal for return type deduction for normal functions > in C++14 for the upcoming Bristol meeting: > > http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3582.html > > and this patch implements the changes in the new proposal relative to > the previous revision. But I forgot to mangle decltype(auto).... commit 962ed442fc4ce39f24aeec858436a82bcc77fa35 Author: Jason Merrill Date: Sat Apr 20 15:39:42 2013 +0100 * mangle.c (write_type): Mangle decltype(auto). diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 83c3e62..8da62b5 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2019,7 +2019,10 @@ write_type (tree type) case TEMPLATE_TYPE_PARM: if (is_auto (type)) { - write_identifier ("Da"); + if (AUTO_IS_DECLTYPE (type)) + write_identifier ("Dc"); + else + write_identifier ("Da"); ++is_builtin_type; break; } diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-mangle1.C b/gcc/testsuite/g++.dg/cpp1y/auto-mangle1.C new file mode 100644 index 0000000..834cfc3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-mangle1.C @@ -0,0 +1,12 @@ +// Mangling for decltype(auto) +// { dg-options "-std=c++1y" } + +void f(); + +// { dg-final { scan-assembler "_Z2g1IiEDcv" } } +template decltype(auto) g1() { return &f; } +template decltype(auto) g1(); + +// { dg-final { scan-assembler "_Z2g2IiEDav" } } +template auto g2() { return &f; } +template auto g2();