From patchwork Fri Nov 14 12:02:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 410799 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9D91F140079 for ; Fri, 14 Nov 2014 23:02:31 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=HuvqgxyGXbXE3qYRXnCuuU7bxydgJKPAVrtYMxIdExUx+wC5tVky5 GGohJhlLRBC+lgMRe+PuhAzcbsPTfsVviUHIIlWDkhJ6DitODYwYTTvu2zHMkTdF fq7aVJAAVfklxX5+CgjgvDOpo1iOuO4LFHeONM2/6cPMGy4Z8UkNOo= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=LJjvY0/u7uIFtrw20orE1VbihL8=; b=R/T8NkZ2u1DGfSxRTW3m BvenaPTFGOsWK53lHM0xQtewBoCfAn5LHvzOlIXg2viDj4NUJIaXBHRh8H8f6SIw mrsSuSIq9j7IgZg4InI/5O+q+FfuotKEOSzN1Cth3qiqrCn3vo+FpzlJhT8qkgrR ADCFZ2ZLzb/R2gADyTjrK6s= Received: (qmail 7951 invoked by alias); 14 Nov 2014 12:02:24 -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 7916 invoked by uid 89); 14 Nov 2014 12:02:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 14 Nov 2014 12:02:18 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAEC2GNq027513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2014 07:02:16 -0500 Received: from localhost (ovpn-116-136.ams2.redhat.com [10.36.116.136]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAEC2F5x013969; Fri, 14 Nov 2014 07:02:16 -0500 Date: Fri, 14 Nov 2014 12:02:15 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] Fix mangling of ABI-tagged std::wstring Message-ID: <20141114120215.GF5191@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Jason approved this yesterday on IRC. Tested powerpc64-linux, committed to trunk. commit 9a8efcc0e2068abb51aaf513b4a7ed262454cd1e Author: Jonathan Wakely Date: Fri Nov 14 11:00:24 2014 +0000 gcc/cp: * mangle.c (find_substitution): Look for abi_tag on class templates. gcc/testsuite: * g++.dg/abi/abi-tag11.C: New. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 048c957..576ad1d 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -609,7 +609,7 @@ find_substitution (tree node) } tree tags = NULL_TREE; - if (OVERLOAD_TYPE_P (node)) + if (OVERLOAD_TYPE_P (node) || DECL_CLASS_TEMPLATE_P (node)) tags = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (type)); /* Now check the list of available substitutions for this mangling operation. */ diff --git a/gcc/testsuite/g++.dg/abi/abi-tag11.C b/gcc/testsuite/g++.dg/abi/abi-tag11.C new file mode 100644 index 0000000..36c1c9f --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/abi-tag11.C @@ -0,0 +1,12 @@ +// { dg-final { scan-assembler "_Z1fSbB3fooIwSt11char_traitsIwESaIwEES3_" } } + +namespace std { + template struct char_traits {}; + template struct allocator {}; + template + struct __attribute ((abi_tag ("foo"))) basic_string { }; + typedef basic_string,allocator > + wstring; +} + +void f(std::wstring,std::wstring) {}