From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 428353856DC7 for ; Thu, 23 Jun 2022 17:03:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 428353856DC7 Received: by mail-lj1-x236.google.com with SMTP id c30so24030335ljr.9 for ; Thu, 23 Jun 2022 10:03:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LeXJSF/INbMUmFJtK/lmywZVC20xttd5Hm9KpRelytk=; b=NLg8Uzk23pT5k3h5B3HN4fdIC2sOgnFvqCTz7G2Y4lLfdnq9kD/uBSe/MeFDS3o/Zm HcWd/4J0GMs8o3OgLkpjoDGpei3x54KwvHcXHTvAhLtuhUGplbULVV4BJ0A89hgklqKR gdagWd9AxSCHxk/40OXmr0qkGaPdicJ2JK6AqXLj8Mj4BoajPp/7vwlvbQvHBWLMQKoq tl+5dj4Iyw/VddFjM50tvTFYIah/n8G7xCjOUIw9F5uAq66YYIYgkDLXajEegtbQTx06 dkeE1+Qd/RKYiQ3EvuIK5Bs0itDHAAMwDmpi/Yaj3e38ew9mn9Q1u91H+Z/p0XI6DVdv VJdw== X-Gm-Message-State: AJIora9K1yLccQ8YDUjhNpLSzckmnMWX2sYjA8yd9L1/IFzvmU91EU1P nz8hIGq+oiuOtDJglGljpjowpl+CPEpyJHW0N6aVIRvv X-Google-Smtp-Source: AGRyM1uJHpb/K06tub1t1NkcPGsshNnjvl8djzya0WuypPOsK02ZfPoolWf1GX8cdWXU/wNcrMLLHJmTsfB3uu+StQE= X-Received: by 2002:a2e:a374:0:b0:25a:666c:d02e with SMTP id i20-20020a2ea374000000b0025a666cd02emr5226039ljn.67.1656003829238; Thu, 23 Jun 2022 10:03:49 -0700 (PDT) MIME-Version: 1.0 From: Lewis Hyatt Date: Thu, 23 Jun 2022 13:03:38 -0400 Message-ID: Subject: Ping^2: [PATCH v2] diagnostics: Honor #pragma GCC diagnostic in the preprocessor [PR53431] To: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3035.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , X-List-Received-Date: Thu, 23 Jun 2022 17:03:54 -0000 Hello- https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595556.html https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431#c49 Would a C++ maintainer have some time to take a look at this patch please? I feel like the PR is still worth resolving. If this doesn't seem like a good way, I am happy to try another -- would really appreciate any feedback. Thanks! -Lewis On Tue, May 24, 2022 at 5:28 PM Lewis Hyatt wrote: > > Hello- > > Now that we're back in stage 1, I thought it might be a better time to > ask for feedback on this pair of patches that tries to resolve PR53431 > please? > > https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587357.html > https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587358.html > > Part 1/2 is a trivial cleanup in the C++ parser that simplifies > adding the support for early pragma handling. > > Part 2/2 adds the concept of early pragma handling and makes the C++ > and preprocessor frontends use it. > > The patches required some minor rebasing, so I have attached updated > versions here. > > bootstrap + regtest all languages still looks good: > > FAIL 103 103 > PASS 541178 541213 > UNSUPPORTED 15177 15177 > UNTESTED 136 136 > XFAIL 4140 4140 > XPASS 17 17 > > Thanks! If this approach doesn't seem like the right one, I am happy > to try another way. > > -Lewis > > > On Fri, Dec 24, 2021 at 04:23:08PM -0500, Lewis Hyatt wrote: > > Hello- > > > > I would like please to follow up on this patch submitted for PR53431 here: > > https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586191.html > > > > However, it was suggested on the PR that part of it could be split into a > > separate simpler patch. I have now done that, and also made a few tweaks to > > the first version at the same time, so may I please request that you review > > this version 2 instead? This email contains the first smaller cleanup patch, > > and the next email contains the main part of it. Thanks very much. > > > > bootstrap and regtest were performed on x86-64 Linux, all tests look the same > > before + after, plus the new passing testcases. > > > > FAIL 112 112 > > PASS 528007 528042 > > UNSUPPORTED 14888 14888 > > UNTESTED 132 132 > > XFAIL 3238 3238 > > XPASS 17 17 > > > > -Lewis > > > From: Lewis Hyatt > > Date: Thu, 23 Dec 2021 17:03:04 -0500 > > Subject: [PATCH] c++: Minor cleanup in parser.c > > > > The code to determine whether a given token starts a module directive is > > currently repeated in 4 places in parser.c. I am about to submit a patch > > that needs to add it in a 5th place, so since the code is not completely > > trivial (needing to check for 3 different token types), it seems worthwhile > > to factor this logic into its own function. > > > > gcc/cp/ChangeLog: > > > > * parser.c (cp_token_is_module_directive): New function > > refactoring common code. > > (cp_parser_skip_to_closing_parenthesis_1): Use the new function. > > (cp_parser_skip_to_end_of_statement): Likewise. > > (cp_parser_skip_to_end_of_block_or_statement): Likewise. > > (cp_parser_declaration): Likewise. > > > > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c > > index 33fb40a5b59..9b7446655be 100644 > > --- a/gcc/cp/parser.c > > +++ b/gcc/cp/parser.c > > @@ -629,6 +629,16 @@ cp_lexer_alloc (void) > > return lexer; > > } > > > > +/* Return TRUE if token is the start of a module declaration that will be > > + terminated by a CPP_PRAGMA_EOL token. */ > > +static inline bool > > +cp_token_is_module_directive (cp_token *token) > > +{ > > + return token->keyword == RID__EXPORT > > + || token->keyword == RID__MODULE > > + || token->keyword == RID__IMPORT; > > +} > > + > > /* Create a new main C++ lexer, the lexer that gets tokens from the > > preprocessor. */ > > > > @@ -3805,9 +3815,7 @@ cp_parser_skip_to_closing_parenthesis_1 (cp_parser *parser, > > break; > > > > case CPP_KEYWORD: > > - if (token->keyword != RID__EXPORT > > - && token->keyword != RID__MODULE > > - && token->keyword != RID__IMPORT) > > + if (!cp_token_is_module_directive (token)) > > break; > > /* FALLTHROUGH */ > > > > @@ -3908,9 +3916,7 @@ cp_parser_skip_to_end_of_statement (cp_parser* parser) > > break; > > > > case CPP_KEYWORD: > > - if (token->keyword != RID__EXPORT > > - && token->keyword != RID__MODULE > > - && token->keyword != RID__IMPORT) > > + if (!cp_token_is_module_directive (token)) > > break; > > /* FALLTHROUGH */ > > > > @@ -3997,9 +4003,7 @@ cp_parser_skip_to_end_of_block_or_statement (cp_parser* parser) > > break; > > > > case CPP_KEYWORD: > > - if (token->keyword != RID__EXPORT > > - && token->keyword != RID__MODULE > > - && token->keyword != RID__IMPORT) > > + if (!cp_token_is_module_directive (token)) > > break; > > /* FALLTHROUGH */ > > > > @@ -14860,9 +14864,7 @@ cp_parser_declaration (cp_parser* parser, tree prefix_attrs) > > else > > cp_parser_module_export (parser); > > } > > - else if (token1->keyword == RID__EXPORT > > - || token1->keyword == RID__IMPORT > > - || token1->keyword == RID__MODULE) > > + else if (cp_token_is_module_directive (token1)) > > { > > bool exporting = token1->keyword == RID__EXPORT; > > cp_token *next = exporting ? token2 : token1; >