From patchwork Fri Jun 24 04:23:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 101717 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 3285AB6F8E for ; Fri, 24 Jun 2011 14:24:04 +1000 (EST) Received: (qmail 20470 invoked by alias); 24 Jun 2011 04:24:00 -0000 Received: (qmail 20433 invoked by uid 22791); 24 Jun 2011 04:23:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Jun 2011 04:23:41 +0000 Received: by qwh5 with SMTP id 5so1373982qwh.20 for ; Thu, 23 Jun 2011 21:23:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.17.148 with SMTP id s20mr948002qca.149.1308889420892; Thu, 23 Jun 2011 21:23:40 -0700 (PDT) Received: by 10.229.47.78 with HTTP; Thu, 23 Jun 2011 21:23:40 -0700 (PDT) In-Reply-To: References: <4E00EAE6.8090709@redhat.com> <4E03F401.7060106@redhat.com> Date: Thu, 23 Jun 2011 21:23:40 -0700 Message-ID: Subject: Re: C++ PATCH for c++/49418 (lost cv-quals on template parameter type) From: "H.J. Lu" To: Jason Merrill Cc: gcc-patches List X-IsSubscribed: yes 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 On Thu, Jun 23, 2011 at 8:07 PM, H.J. Lu wrote: > On Thu, Jun 23, 2011 at 7:18 PM, Jason Merrill wrote: >> On 06/23/2011 08:45 PM, H.J. Lu wrote: >>> >>> This caused: >>> >>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49519 >> >> I'm checking this in as an alternate fix.  Testing hasn't completed yet, but >> I'm confident that this version is safe. >> > > I still got the same failure with revision 175368.  The problem is caused by > the "While looking at this, I've also changed a few more TYPE_MAIN_VARIANTs > to cv_unqualified" change in > > http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01622.html Revert this patch: seems to fix the crash. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4d2caa8..2716f78 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -10246,7 +10246,7 @@ tsubst_arg_types (tree arg_types, /* Do array-to-pointer, function-to-pointer conversion, and ignore top-level qualifiers as required. */ - type = TYPE_MAIN_VARIANT (type_decays_to (type)); + type = cv_unqualified (type_decays_to (type)); /* We do not substitute into default arguments here. The standard mandates that they be instantiated only when needed, which is