From patchwork Wed Aug 7 01:17:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 265294 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 CBFCF2C009F for ; Wed, 7 Aug 2013 11:17:31 +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:content-type; q= dns; s=default; b=NhA1fFwD/xABZPcgUvigDfTDOrWwdnP7NYtWlGe0yo7J0J B/D/r6I2RYCXRg9cs/SMnESjzx+lU3GniN3XM2xEOhjotpjhzspfq7CGDK8a/Yc+ gV4bmRNDrVB3Hsk3L4TB+/0FSs/gLcK4fZ11d5kr3Tz3x+2qWDhEc+zamHvPI= 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:content-type; s= default; bh=Scd7rqqZ3WtWEQ+4+6/Fgphv7e4=; b=U5eXRIHlvJ1BJOXsq2ff dPq0fIB9hsTqodcD9wgF9V+APgyNyo9gQqCYNHaVqzgZxD+cO9xM/p528yiKrQIO WrCmPo09fOTiHYbf+c9X2UUmLgkxKxUokEmpJsPmN3BZL36DNz9I8WyS8OCxgdQI styCGsV9DD42DqKSAqrG75M= Received: (qmail 7861 invoked by alias); 7 Aug 2013 01:17:22 -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 7832 invoked by uid 89); 7 Aug 2013 01:17:21 -0000 X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RDNS_NONE, SPF_HELO_PASS, SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 07 Aug 2013 01:17:20 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r771HCPa004896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Aug 2013 21:17:13 -0400 Received: from [10.10.116.18] ([10.10.116.18]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r771HCSP018169 for ; Tue, 6 Aug 2013 21:17:12 -0400 Message-ID: <5201A018.1080600@redhat.com> Date: Tue, 06 Aug 2013 21:17:12 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0a2 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/57825 (ref-qualifier lost on template argument) X-Virus-Found: No Simple oversight. Tested x86_64-pc-linux-gnu, applying to trunk and 4.8. commit e468033b49ddb6cadfd3c07d3ac0b81d80bc523a Author: Jason Merrill Date: Tue Aug 6 19:49:40 2013 -0400 PR c++/57825 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index f8b4bbc..63ec7fa 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1236,6 +1236,8 @@ strip_typedefs (tree t) result = build_method_type_directly (class_type, type, TREE_CHAIN (arg_types)); + result + = build_ref_qualified_type (result, type_memfn_rqual (t)); } else { diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C new file mode 100644 index 0000000..8e55551 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C @@ -0,0 +1,18 @@ +// PR c++/57825 +// { dg-do compile { target c++11 } } + +template +struct target_class +{}; + +template +struct target_class +{}; + +template +struct target_class +{}; + +template +struct target_class +{};