From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5790 invoked by alias); 13 Oct 2014 18:43:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 5777 invoked by uid 89); 13 Oct 2014 18:43:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-qg0-f53.google.com Received: from mail-qg0-f53.google.com (HELO mail-qg0-f53.google.com) (209.85.192.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 13 Oct 2014 18:43:46 +0000 Received: by mail-qg0-f53.google.com with SMTP id q107so1592573qgd.12 for ; Mon, 13 Oct 2014 11:43:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YefNHssyzL8FWWnTbpq2v+hqAJ1Vjb2it48Iem1/pC0=; b=L4bNh8qBRTl+vEVJjRZyTYjRBH/JfmrybdkM02qFzKGeFYLvpmjFtUwSU7rk2dGGzV 35iS139d3vYgh0aA0dIVT7helD0t6cM3drahKNGqh6b/677pp+7mcNjEb3e/ztSaWev2 FAbd1gijlvv0jHdn9IjMe8GBvsyunT6OvVpBVQVK8jcQCWA2rZ9ZHBhUCCwgEK6IFWK+ SUaNi+zQilJkdQiYhRtaRu0KIi6UjYz2UT8Tyr061KtLXIXXvrhQ8jJ0g6ui8YsGzvp0 v7wyJZEKRWwQ5HuQY+VVV/67uJ32gx2UzgR8LJHV5P2HejTicHFWwmiIvGVBdTbhXPo4 buPw== X-Gm-Message-State: ALoCoQmHWTH27WcfQYCd9XRS1sTh8HrEEffgER9CcQMrwYlIWzrKsCL5JEpKY7Zbv1vJssTP8ert MIME-Version: 1.0 X-Received: by 10.229.33.196 with SMTP id i4mr857362qcd.4.1413225823654; Mon, 13 Oct 2014 11:43:43 -0700 (PDT) Received: by 10.140.81.51 with HTTP; Mon, 13 Oct 2014 11:43:43 -0700 (PDT) In-Reply-To: <53D22072.4000200@redhat.com> References: <1401191856-27585-1-git-send-email-palves@redhat.com> <1401191856-27585-3-git-send-email-palves@redhat.com> <538C7F4F.4050800@redhat.com> <53D22072.4000200@redhat.com> Date: Mon, 13 Oct 2014 18:46:00 -0000 Message-ID: Subject: Re: [PATCH 2/3] PR other/61321 - demangler crash on casts in template parameters From: Cary Coutant To: Pedro Alves Cc: Jason Merrill , gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg01175.txt.bz2 Ping. Jason, do you still think the special-case for conversion ops is inappropriate? -cary On Fri, Jul 25, 2014 at 2:16 AM, Pedro Alves wrote: > On 07/24/2014 11:35 PM, Cary Coutant wrote: >>> It seems that the problem here is more general; a template argument list is >>> not in scope within that same template argument list. Can't we fix that >>> without special-casing conversion ops? >> >> I think conversion ops really are a special case. > > Thanks Cary. FWIW, I agree. > > (GDB 7.8 hasn't been released yet, though it's close. If this > patch is approved as is, we'll be able to have the crash > fixed there. If this requires a significant rewrite though, > I'm afraid I might not be able to do it myself anytime soon.) > >> It's the only case >> where the template parameters refer to the template argument list from >> the cast operator's enclosing template. In a cast expression, like >> anywhere else you might have a template parameter, the template >> parameter refers to the template argument list of the immediately >> enclosing template. >> >> I think this note from Section 5.1.3 (Operator Encodings) of the ABI >> is what makes this a special case (it's an informative comment in the >> document, but seems to me to be normative): >> >> "For a user-defined conversion operator the result type (i.e., the >> type to which the operator converts) is part of the mangled name of >> the function. If the conversion operator is a member template, the >> result type will appear before the template parameters. There may be >> forward references in the result type to the template parameters." >> > > -- > Thanks, > Pedro Alves >