public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Patrick Palka <ppalka@redhat.com>, gcc-patches@gcc.gnu.org
Cc: nathan@acm.org
Subject: Re: [PATCH] c++/modules: relax diagnostic about GMF contents
Date: Thu, 15 Feb 2024 16:21:25 -0500	[thread overview]
Message-ID: <57d9a71a-998a-4ff6-ac0f-d99846fbab47@redhat.com> (raw)
In-Reply-To: <20240215211019.340428-1-ppalka@redhat.com>

On 2/15/24 16:10, Patrick Palka wrote:
> Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look
> OK for trunk?
> 
> -- >8 --
> 
> Issuing a hard error when the GMF doesn't contain preprocessing
> directives is inconvenient for automated testcase reduction via cvise.
> This patch relaxes this diagnostic into a pedwarn.
> 
> gcc/cp/ChangeLog:
> 
> 	* parser.cc (cp_parser_translation_unit): Relax GMF contents
> 	error into a pedwarn.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/modules/friend-6_a.C: Remove now unnecessary
> 	preprocessing directives from GMF.
> ---
>   gcc/cp/parser.cc                          | 6 +++---
>   gcc/testsuite/g++.dg/modules/friend-6_a.C | 2 --
>   2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
> index 9d0914435fb..e60f0425035 100644
> --- a/gcc/cp/parser.cc
> +++ b/gcc/cp/parser.cc
> @@ -5253,9 +5253,9 @@ cp_parser_translation_unit (cp_parser* parser)
>   	      if (!warned)
>   		{
>   		  warned = true;
> -		  error_at (token->location,
> -			    "global module fragment contents must be"
> -			    " from preprocessor inclusion");
> +		  pedwarn (token->location, OPT_Wpedantic,
> +			   "global module fragment contents must be"
> +			   " from preprocessor inclusion");

Relaxing to pedwarn is fine, but I think it should be on by default, not 
just with -pedantic.  So it should get a new option.

Jason


  reply	other threads:[~2024-02-15 21:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 21:10 Patrick Palka
2024-02-15 21:21 ` Jason Merrill [this message]
2024-02-15 21:51   ` Patrick Palka
2024-02-27 17:56     ` Patrick Palka
2024-03-01 19:11     ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57d9a71a-998a-4ff6-ac0f-d99846fbab47@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    --cc=ppalka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).