From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102578 invoked by alias); 29 Nov 2018 21:04:01 -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 102558 invoked by uid 89); 29 Nov 2018 21:04:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy= X-HELO: mail-qt1-f174.google.com Received: from mail-qt1-f174.google.com (HELO mail-qt1-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Nov 2018 21:03:59 +0000 Received: by mail-qt1-f174.google.com with SMTP id l11so3675590qtp.0 for ; Thu, 29 Nov 2018 13:03:59 -0800 (PST) Return-Path: Received: from [192.168.1.149] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id l15sm1298170qtr.25.2018.11.29.13.03.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 13:03:56 -0800 (PST) Subject: Re: C++ PATCH for c++/88184, ICE when treating name as template-name To: Marek Polacek Cc: GCC Patches References: <20181128154849.GD3269@redhat.com> <51f04722-f35d-7df0-40a3-dc7926c82981@redhat.com> <20181129182828.GH3269@redhat.com> From: Jason Merrill Message-ID: <5e3b0168-e98b-b9ac-e4da-a939b445ab98@redhat.com> Date: Thu, 29 Nov 2018 21:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181129182828.GH3269@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg02494.txt.bz2 On 11/29/18 1:28 PM, Marek Polacek wrote: > On Wed, Nov 28, 2018 at 10:34:11PM -0500, Jason Merrill wrote: >> On 11/28/18 10:48 AM, Marek Polacek wrote: >>> Since P0846R0 was implemented, a name will be treated as a template-name when >>> it is an unqualified-id followed by a < and name lookup finds either one or >>> more functions or finds nothing, in order to potentially cause ADL to be performed. >>> >>> In this case, we had >>> >>> f (); >>> >>> where we'd found a decl for f (not a TEMPLATE_DECL) and < follows. >> >> From the backtrace in the PR, it seems as though we're treating f as >> non-dependent, which is wrong. type_dependent_expression_p only looks at >> the arguments of a TEMPLATE_ID_EXPR if it has unknown_type_node, so we >> probably want to give it that type. > > That was my first attempt but it was crashing everywhere, so I abandoned it. > But I was setting unknown_type_node in cp_parser_template_name whereas this > patch sets it in cp_parser_postfix_expression, which works and is arguably > better because it reuses the diagnostic in finish_call_expr. Would it work for lookup_template_function to always use unknown_type_node? Jason