From patchwork Fri Nov 6 14:00:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1395681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@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.a=rsa-sha256 header.s=20161025 header.b=P9PAGDmt; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CSMTn4nC2z9sSn for ; Sat, 7 Nov 2020 01:00:12 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C5EC3988833; Fri, 6 Nov 2020 14:00:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id C1EA73857823 for ; Fri, 6 Nov 2020 14:00:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C1EA73857823 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qk1-x730.google.com with SMTP id l2so1093483qkf.0 for ; Fri, 06 Nov 2020 06:00:04 -0800 (PST) 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=ubdrR/ELgKS+lty4Rxfn3oSVXV+uzVCqH6rh5bt9Ln0=; b=P9PAGDmtyKtUfKZJfE0HzkkZ4AzB14VlKgqqLUmznEpirlQJhR+CR8YPnTCJVNaTqD X030PF2L6bA1ZfIuNINHpLNrF0RAnQjBfAMo2dGRgSbtGI0lgcvywpAfktc/UcrJjqmp 4YIjRDMTXEEPWYDID+Aab/7P/OZ5lt/GmQmH/aM9ORWU2jeySFaNFsXMMpEW7u9AO3aI cMM040w9XGs1QdA2BY0MexOjS4sJtSMJHWgk/Kilut1P3zi7RUQLokqeVkT5ptvBj35X zFRbZ+f1SmBAS2B1vCfp+AcKhxd3UvcjMUuGP4Dty3xJh5pQ27QkQsw+nB/3XGI33Y6U fW1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=ubdrR/ELgKS+lty4Rxfn3oSVXV+uzVCqH6rh5bt9Ln0=; b=VWMyCEAQvbco2ouRsmw4hS4CcTIyVBdJ38prmyjT+P9ap3NPEHJAakXiyaKRCOQRKT JEgRucZ34e88Sv7M79tm9fke/5r/JN6jCQziyTl2nLvyiKBAOksQINOR9kdPXakKDB8N wx7sB9CIJK39/Q4M/S8TOJZ7n5nFVEkXTDYZDN7a9HaQC4qNlH8jAYOkSROp92/eVWQt 3OT/1xh0pwKFM7s/+EM+uGDVYUe3qnQMgQRXoNdP8HPqczzggRxpWukMr0AzQVfCocFT e+1lMacgmXWRRO6QuE6lo27V2yQ3tPW8yXZBf53JVVSbpMIL8xEeKSLvb6uvjrkMja96 sUkw== X-Gm-Message-State: AOAM530bbdEDzxCa3RiJXVDpy/cjR4v7MqqM54GUNwy4GQdzkacn/r76 qFzDMxpgLUREjAOb15Iaqrw= X-Google-Smtp-Source: ABdhPJxD6KhdjZGOHP/rePxk2fDoNZ7rxYMoCqWfhEEZXoPxNf3h1IsPANYjTuZ5nWsPNUkozsgyrQ== X-Received: by 2002:a05:620a:311:: with SMTP id s17mr1673543qkm.482.1604671204204; Fri, 06 Nov 2020 06:00:04 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:858f:cc6c:e2a0:8b92? ([2620:10d:c091:480::1:f5b0]) by smtp.googlemail.com with ESMTPSA id j50sm584267qtc.5.2020.11.06.06.00.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Nov 2020 06:00:02 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: c++: Parser tweaks Message-ID: <697cc2cb-b542-4eab-94ff-f419dce0f70e@acm.org> Date: Fri, 6 Nov 2020 09:00:01 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" We need to adjust the wording for 'export'. Between c++11 and c++20 it is deprecated. Outside those ranges it is unsupported (at the moment). While here, there's also an unneeded setting of a bool -- it's inside an if block that just checked it was true. gcc/cp/ * parser.c (cp_parser_template_declaration): Adjust 'export' warning. (cp_parser_explicit_specialization): Remove unneeded bool setting. pushing to trunk diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c index e7bfbf649a5..c948dc9d050 100644 --- i/gcc/cp/parser.c +++ w/gcc/cp/parser.c @@ -16031,8 +16031,13 @@ cp_parser_template_declaration (cp_parser* parser, bool member_p) { /* Consume the `export' token. */ cp_lexer_consume_token (parser->lexer); - /* Warn that we do not support `export'. */ - warning (0, "keyword % not implemented, and will be ignored"); + /* Warn that this use of export is deprecated. */ + if (cxx_dialect < cxx11) + warning (0, "keyword % not implemented, and will be ignored"); + else if (cxx_dialect < cxx20) + warning (0, "keyword % is deprecated, and is ignored"); + else + warning (0, "keyword % not implemented, and will be ignored"); } cp_parser_template_declaration_after_export (parser, member_p); @@ -17753,7 +17758,6 @@ cp_parser_explicit_specialization (cp_parser* parser) /* Give it C++ linkage to avoid confusing other parts of the front end. */ push_lang_context (lang_name_cplusplus); - need_lang_pop = true; } /* Let the front end know that we are beginning a specialization. */