From patchwork Thu Sep 19 18:37:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Butcher X-Patchwork-Id: 276037 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 did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E733C2C010B for ; Fri, 20 Sep 2013 04:38:42 +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:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=R0ECNILCI4dpl9Eg/VxXQ8VM0XSfgbxNMUi11JB7qLK9bC1BQaHKf 6jCYKZ1rTBCYOoSRnAeps734gdMZ3xPZUQD+3A0hMALxE7xqSZYVmKkw24h3zku8 YwVBPh/5hVsmQTIUUKJhcRIk5du7BoHaNOd1tU9Qk1X/nxRrSGMMOg= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=VPLsENQGzZ5os3Bzhdb1pqDrL8M=; b=UP5wjW2MKeh9ZPHaKNW4 FcqkRoqM/y8CyBm28ACnrFkr75J+bsPr3KtSqQK0HNNLlbT8FZqHhpvA+50PVCYa XbsnGrJW0hwW0aAWBNbNus+FJycTVDwmgAx+ORAo5UT8O2TjyTw+l18H0Q1fODWA oiCEdRLLGXGVFrY24aRJq5M= Received: (qmail 10990 invoked by alias); 19 Sep 2013 18:38:05 -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 10939 invoked by uid 89); 19 Sep 2013 18:38:04 -0000 Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Sep 2013 18:38:04 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED, AWL, BAYES_00, FREEMAIL_FROM, KHOP_THREADED autolearn=ham version=3.3.2 X-HELO: mail-wi0-f181.google.com Received: by mail-wi0-f181.google.com with SMTP id ex4so8481952wid.8 for ; Thu, 19 Sep 2013 11:38:01 -0700 (PDT) X-Received: by 10.180.85.65 with SMTP id f1mr12572358wiz.33.1379615880978; Thu, 19 Sep 2013 11:38:00 -0700 (PDT) Received: from sphere.lan (munkyhouse.force9.co.uk. [84.92.244.81]) by mx.google.com with ESMTPSA id i8sm11854983wib.1.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Sep 2013 11:38:00 -0700 (PDT) From: Adam Butcher To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Adam Butcher Subject: [C++1y] [PATCH 3/4] Ensure implicit template parameters have distinct canonical types. Date: Thu, 19 Sep 2013 19:37:46 +0100 Message-Id: <1379615867-21555-4-git-send-email-adam@jessamine.co.uk> In-Reply-To: <1379615867-21555-1-git-send-email-adam@jessamine.co.uk> References: <1379615867-21555-1-git-send-email-adam@jessamine.co.uk> * parser.c (add_implicit_template_parms): Set the canonical type of a generic parameter to be that of the newly generated type such that it is unique. --- gcc/cp/parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7e9ade2..148e2f2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -29005,6 +29005,9 @@ add_implicit_template_parms (cp_parser *parser, size_t expect_count, cur_type = cp_build_qualified_type (new_type, TYPE_QUALS (cur_type)); else cur_type = new_type; + + /* Make the canonical type of the parameter distinct. */ + TYPE_CANONICAL (TREE_TYPE (TREE_VALUE (p))) = cur_type; } gcc_assert (synth_count == expect_count);