From patchwork Tue Apr 10 14:10:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 896724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476134-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Cdy6uUh2"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40L8Fs3k94z9s19 for ; Wed, 11 Apr 2018 00:10:24 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=rF6bYGXa+9ApLVl8gJF6kMN1Co1/H ZtnoRJA6a2DmTySKrc4LQq6znqeqPgfGw8OLwM6w49sTkJV+FR38LD9dEcMAuGGw T5tTzERW5cEPFORej8ZdJuQynPkcm8V5OK4QcvUixFauO7MHamhoWqEvGaNBzoKe rNtsLucT35J5dU= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=Q2LvOCjupRTj3yd8/S2BWkX8GbM=; b=Cdy 6uUh2mtX3rWRnLLUqLjs1NI9qB+lzMunr3G9RT4P0UCwPgqri9bDPAvAimLB6c7b rt0qasRHPBDI421A9PLCHlMymP8Y8yK74XsC7wHBUvmD+Ncn/MKTfqW8Wm0W8sLY cCn/8vDD15YfdIqPkIdkc6OlFuxZw/ztSDZOQSG8= Received: (qmail 72671 invoked by alias); 10 Apr 2018 14:10:17 -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 70798 invoked by uid 89); 10 Apr 2018 14:10:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Apr 2018 14:10:09 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 773C0406F890; Tue, 10 Apr 2018 14:10:08 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.36.118.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 359D2215CDC6; Tue, 10 Apr 2018 14:10:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w3AEA6OT014212; Tue, 10 Apr 2018 16:10:06 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w3AEA5Ks014211; Tue, 10 Apr 2018 16:10:05 +0200 Date: Tue, 10 Apr 2018 16:10:05 +0200 From: Jakub Jelinek To: Jason Merrill , Ville Voutilainen Cc: gcc-patches@gcc.gnu.org Subject: [C++ PATCH] P0962 change cleanup (PR c++/85312) Message-ID: <20180410141005.GJ8577@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes Hi! The "Implement P0962" change changed the if (member_begin != NULL_TREE || member_end != NULL_TREE) condition to if (member_begin != NULL_TREE && member_end != NULL_TREE) but that created a lot of dead-code, because now the diagnostics in that if is unreachable, we are always guaranteed both member_begin and member_end are non-NULL in that block. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2018-04-10 Jakub Jelinek PR c++/85312 - P0962 cleanup * parser.c (cp_parser_perform_range_for_lookup): Remove unreachable diagnostics. Jakub --- gcc/cp/parser.c.jj 2018-04-10 08:52:24.697790705 +0200 +++ gcc/cp/parser.c 2018-04-10 12:40:11.359290679 +0200 @@ -12041,17 +12041,8 @@ cp_parser_perform_range_for_lookup (tree if (member_begin != NULL_TREE && member_end != NULL_TREE) { /* Use the member functions. */ - if (member_begin != NULL_TREE) - *begin = cp_parser_range_for_member_function (range, id_begin); - else - error ("range-based % expression of type %qT has an " - "% member but not a %", TREE_TYPE (range)); - - if (member_end != NULL_TREE) - *end = cp_parser_range_for_member_function (range, id_end); - else - error ("range-based % expression of type %qT has a " - "% member but not an %", TREE_TYPE (range)); + *begin = cp_parser_range_for_member_function (range, id_begin); + *end = cp_parser_range_for_member_function (range, id_end); } else {