From patchwork Thu May 14 15:07:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1290465 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=JU2nF1l+; 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 49NFKZ3clmz9sVb for ; Fri, 15 May 2020 01:08:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D33D396E836; Thu, 14 May 2020 15:08:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id 42570396E007 for ; Thu, 14 May 2020 15:08:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 42570396E007 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-x735.google.com with SMTP id m11so1328274qka.4 for ; Thu, 14 May 2020 08:08:00 -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=dp1lKO+lOCRNcCwyN2rkBJjhHszLScK+14wyWU7DASo=; b=JU2nF1l+IOUGPB8gVEAwW5S9y0Rd540cbaak5qH/jqDiggLApqEJdzv6dfKfc/2XKZ z0DfriiGIAeK2PbQ6bYk8pEnHLghat3a5d8nUytaNs4kZKjJFljsptKB/c7jhCK0yx4M 3lzimFTPrzyh7q+khxZ4RNg2uu/QtYPWHM0laZoUMXTPcGd7GLHdQBCNLxqwTn4XpoOC pcP0scObsp2T/xkKgpmNmjeXyjE0FUWSlowznYXEfghlxwzlseDCE9plY/S2tgoOpuTP UpbQxpBScEDouw3VY8RNNyOONmW9CcSmZh7xBYMtF13BaUaZ1tF3IuNjQH8uCMnJTayU kh6w== 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=dp1lKO+lOCRNcCwyN2rkBJjhHszLScK+14wyWU7DASo=; b=WOv1OB37GAnkcGns8HzVVCTKgXBvUrTeIc31YXLLZxJtZB3cz1zL4ZBo16FRr0D5Yg eS9KGLrOvpWZmaRYcvXrLFrobYHcpfn9qP7rP7AKQvTxPTL5/TwIUGvV3+aCzJ0yuA7x PWXJskRoFV2rUQV8CS5fAA9LBuRmsRqjIzC7WwWsAHcXubDwlXMpWGpdDqiK+7u0pHXI zJHPujQlDup2vOQRjT56fwx6Jg/ISeoAuwRHLWRRKYy9NQz0iqcHSdCWFqzfqaZe8jvb HyXzeuV68JJGUERaNJgo/k05so85kXKi4T544Tq5eVAZw+VgHuiLyWxQ3MtQvDW12HYC nDdA== X-Gm-Message-State: AOAM532W8TylSnhkTbc6xClKWq2H5nP4zaD508RSD31t7Lp96mjXAys6 CMO3PFork+EUmzK4KwGm+v8= X-Google-Smtp-Source: ABdhPJzU7AK2R26PhHYS4S5KzWELDsRwbOd7F6di51va0EttgS6el2U8h2xFx6nsl1DbndlBuuh/Aw== X-Received: by 2002:a37:27d6:: with SMTP id n205mr5313338qkn.149.1589468879696; Thu, 14 May 2020 08:07:59 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a8:1102:fc0e:cf70:828a:a237? ([2620:10d:c091:480::1:158e]) by smtp.googlemail.com with ESMTPSA id t202sm2681284qke.97.2020.05.14.08.07.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 08:07:58 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++] a missed c++2a->c++20 Message-ID: <482bfb5d-bdfd-78ad-6252-4d367838ce1a@acm.org> Date: Thu, 14 May 2020 11:07:57 -0400 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=-10.0 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, KAM_NUMSUBJECT, 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" Jason missed a c++2a mention. I couldn't resist changing the loop following to place the initializers inside the fors. pushed to master nathan 2020-05-14 Nathan Sidwell * parser.c (cp_parser_diagnose_invalid_typename): Mention std=c++20 not 2a, reformat dependent binfo inform loops. diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c index bc1ee21e8ce..41712bfdc2c 100644 --- i/gcc/cp/parser.c +++ w/gcc/cp/parser.c @@ -3376,41 +3376,35 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id, inform (location, "% only available with %<-std=c++20%> or " "%<-fconcepts%>"); else if (!flag_concepts && id == ridpointers[(int)RID_REQUIRES]) - inform (location, "% only available with %<-std=c++2a%> or " + inform (location, "% only available with %<-std=c++20%> or " "%<-fconcepts%>"); else if (processing_template_decl && current_class_type && TYPE_BINFO (current_class_type)) { - tree b; - - for (b = TREE_CHAIN (TYPE_BINFO (current_class_type)); - b; - b = TREE_CHAIN (b)) + for (tree b = TREE_CHAIN (TYPE_BINFO (current_class_type)); + b; b = TREE_CHAIN (b)) { tree base_type = BINFO_TYPE (b); if (CLASS_TYPE_P (base_type) && dependent_type_p (base_type)) { - tree field; /* Go from a particular instantiation of the template (which will have an empty TYPE_FIELDs), to the main version. */ base_type = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (base_type); - for (field = TYPE_FIELDS (base_type); - field; - field = DECL_CHAIN (field)) + for (tree field = TYPE_FIELDS (base_type); + field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == TYPE_DECL && DECL_NAME (field) == id) { inform (location, "(perhaps % was intended)", BINFO_TYPE (b), id); - break; + goto found; } - if (field) - break; } } + found:; } } /* Here we diagnose qualified-ids where the scope is actually correct,