From patchwork Thu May 2 12:40:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1094211 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-499986-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hiQCOa6F"; 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 44vvyc2yjFz9s9y for ; Thu, 2 May 2019 22:41:25 +1000 (AEST) Received: (qmail 61629 invoked by alias); 2 May 2019 12:41:20 -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 61620 invoked by uid 89); 2 May 2019 12:41:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=We'll, sk:finish_, error_mark_node, HX-Spam-Relays-External:sk:mail-pf X-HELO: mail-pf1-f169.google.com Received: from mail-pf1-f169.google.com (HELO mail-pf1-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 May 2019 12:41:18 +0000 Received: by mail-pf1-f169.google.com with SMTP id j11so1038539pff.13 for ; Thu, 02 May 2019 05:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=3FGu/zMKMeBPqZzwU9eavTtxvXdpn5FagXsIFQCKwmQ=; b=hiQCOa6Fw25WYTYe2vRhcjp9nJ+gIKK4duwW1T1Hk4gBxBm+Y3mfgN5BPxibfN7sU/ /ASi8mMI9vDWHeeD+mOS4JRJF1IPRfOtYh4BTpUUqQas2IRnRlm3UqLP/ip91FriYTDB iPnZY/AlNwrSYFeaXy/pCYTgcIuY0sFBtJMB1w6Ly3p7dKii993EuQOFtlLQEXuIWzWV JYViRtlfiGG5LaQ27VeZtWLGBR6z5MgjIf1wOwkXIc3iRCwubgYqkUSbtbO/29MfECfA f7gnIzgq0HjZTEO/6n9o+zEM8vyrX6QB6Alc/u0/GS3eQR00CPpgSFFJds1eCW7iPo+a W15Q== Received: from ?IPv6:2620:10d:c0a3:1407:e9b5:58e4:53e1:807? ([2620:10d:c091:200::1:615e]) by smtp.googlemail.com with ESMTPSA id f15sm51179854pgf.18.2019.05.02.05.40.10 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 05:40:11 -0700 (PDT) Sender: Nathan Sidwell To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] remove unreachable code Message-ID: <12337eef-ead2-fdc9-da03-9f7e804b3b14@acm.org> Date: Thu, 2 May 2019 08:40:09 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Applying this patch to remove code that has become unreachable. We'll already have bailed out if it was a NAMESPACE_DECL. nathan 2019-05-02 Nathan Sidwell * semantics.c (finish_id_expression_1): Remove unreachable code. Index: gcc/cp/semantics.c =================================================================== --- gcc/cp/semantics.c (revision 270791) +++ gcc/cp/semantics.c (working copy) @@ -3740,17 +3740,13 @@ finish_id_expression_1 (tree id_expressi wrong, so just return the identifier. */ return id_expression; - if (TREE_CODE (decl) == NAMESPACE_DECL) - { - error ("use of namespace %qD as expression", decl); - return error_mark_node; - } - else if (DECL_CLASS_TEMPLATE_P (decl)) + if (DECL_CLASS_TEMPLATE_P (decl)) { error ("use of class template %qT as expression", decl); return error_mark_node; } - else if (TREE_CODE (decl) == TREE_LIST) + + if (TREE_CODE (decl) == TREE_LIST) { /* Ambiguous reference to base members. */ error ("request for member %qD is ambiguous in "