From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128815 invoked by alias); 2 Feb 2018 20:13:45 -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 128798 invoked by uid 89); 2 Feb 2018 20:13:44 -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_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1829 X-HELO: mail-io0-f174.google.com Received: from mail-io0-f174.google.com (HELO mail-io0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Feb 2018 20:13:43 +0000 Received: by mail-io0-f174.google.com with SMTP id f89so24174016ioj.4 for ; Fri, 02 Feb 2018 12:13:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T1m5HMkkyCLMtc/Zr5NiWHq+3/H3vgSZ/KCKEt5yNo8=; b=CIyhw+PGKN+IzB6A8DYUJnESAkhGw2aG/tH8Odsd6nmdasHXhQRKvpBbM6FnebR2dZ v4XtkxAN9Ko8bfMsz9pJILMjg+rtQl3hXyRFw01ISakrfRVwvSm+L7KlvQY8g3SAMcix 2AOxlAzWYmB46dyM1973FP95q+rQyl5LDB8Bu5ho7t8wRcqHcW6qP3xbXpr6E2a4kT+t x207Qm8pJPLXGetUDO4ZWkUGf7wCANQnPnLx4ZeVNAuSZ3HyUCq9gXvl2LcBjpS/fmnu 0N1sF4WasCW4SY3IIX2wiqbilVqYLKgl/zV/kdEKNYxawhTEOJxxtdFo1OCH4yww8z5S ASJg== X-Gm-Message-State: AKwxytee1vAZwO/WfYSr6OHV0L8JU8Zwej2pWVy7SG4m83GUvsHxS5K9 2Bj0SLJyGDuwhWJhB1Mz53jbQcgtNG42jES3qfJrWw== X-Google-Smtp-Source: AH8x226E3BMzEMppiFaNs4S317AjuysjEenTY8FgiT46we3a3TrUAauKhv2eL/pvi9EabYZvvqp506JZqqAKWFmiG6Q= X-Received: by 10.107.133.75 with SMTP id h72mr43464330iod.227.1517602421641; Fri, 02 Feb 2018 12:13:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.17.206 with HTTP; Fri, 2 Feb 2018 12:13:21 -0800 (PST) In-Reply-To: <20180129232912.GT2063@tucnak> References: <20180129232912.GT2063@tucnak> From: Jason Merrill Date: Fri, 02 Feb 2018 20:13:00 -0000 Message-ID: Subject: Re: [C++ PATCH] Fix ICEs due to cp_parser_postfix_dot_deref_expression workaround (PR c++/84082) To: Jakub Jelinek Cc: Marek Polacek , gcc-patches List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00130.txt.bz2 On Mon, Jan 29, 2018 at 6:29 PM, Jakub Jelinek wrote: > Hi! > > In r245223 cp_parser_postfix_dot_deref_expression has been changed to > workaround some buggy template code with a pedwarn instead of error, > in r245440 Marek tweaked that by adding the && EXPR_P (postfix_expression) > because we really don't want to clear TREE_TYPE on OVERLOADs or on DECLs > that have incomplete type. > > There are some expression types where we don't want to clear TREE_TYPE > either, like *CAST_EXPR, or VIEW_CONVERT_EXPR, these in various spots > assume they have non-NULL TREE_TYPE. > > So, the following patch extends it by looking at the various > postfix_expression kinds and deciding what to do by tweaking kind. > Changing kind from DK_PEDWARN where it pedwarns + clears TREE_TYPE and scope > to DK_ERROR will result in an error + what we used to do before r245223, > i.e. scope = error_mark_node and postfix_expression = error_mark_node too. > Changing kind to DK_IGNORED will do what Marek's patch did, not diagnose > anything at that point, let other code diagnose incomplete type later on > or diagnose some other error. For OVERLOAD that seems like a better > choice, not really sure about other cases. For now the patch uses DK_ERROR > and thus what we used to do before r245223 for non-OVERLOAD. At least > when not processing_template_decl I'd say it is better to error right away. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Or should I change the switch body to do other kind = overrides? I think we want to avoid clobbering NON_LVALUE_EXPR location wrappers, too. This has gotten large enough that it should break out into its own function. OK with those changes. Jason