public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] attribs: Add missing auto_diagnostic_group 3 times
@ 2022-10-04  9:11 Jakub Jelinek
  2022-10-04 12:27 ` David Malcolm
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2022-10-04  9:11 UTC (permalink / raw)
  To: Richard Biener, David Malcolm; +Cc: gcc-patches

Hi!

In these spots, the error/error_at has some inform afterwards which are
explanation part of the same diagnostics, so should be tied with
auto_diagnostic_group with it.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2022-10-04  Jakub Jelinek  <jakub@redhat.com>

	* attribs.cc (handle_ignored_attributes_option, decl_attributes,
	common_function_versions): Use auto_diagnostic_group.

--- gcc/attribs.cc.jj	2022-10-03 18:31:16.130032566 +0200
+++ gcc/attribs.cc	2022-10-03 21:27:02.364104260 +0200
@@ -251,6 +251,7 @@ handle_ignored_attributes_option (vec<ch
       /* We don't accept '::attr'.  */
       if (cln == nullptr || cln == opt)
 	{
+	  auto_diagnostic_group d;
 	  error ("wrong argument to ignored attributes");
 	  inform (input_location, "valid format is %<ns::attr%> or %<ns::%>");
 	  continue;
@@ -732,6 +733,7 @@ decl_attributes (tree *node, tree attrib
 	      || (spec->max_length >= 0
 		  && nargs > spec->max_length))
 	    {
+	      auto_diagnostic_group d;
 	      error ("wrong number of arguments specified for %qE attribute",
 		     name);
 	      if (spec->max_length < 0)
@@ -1167,6 +1169,7 @@ common_function_versions (tree fn1, tree
 	      std::swap (fn1, fn2);
 	      attr1 = attr2;
 	    }
+	  auto_diagnostic_group d;
 	  error_at (DECL_SOURCE_LOCATION (fn2),
 		    "missing %<target%> attribute for multi-versioned %qD",
 		    fn2);

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] attribs: Add missing auto_diagnostic_group 3 times
  2022-10-04  9:11 [PATCH] attribs: Add missing auto_diagnostic_group 3 times Jakub Jelinek
@ 2022-10-04 12:27 ` David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2022-10-04 12:27 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Biener; +Cc: gcc-patches

On Tue, 2022-10-04 at 11:11 +0200, Jakub Jelinek wrote:
> Hi!
> 
> In these spots, the error/error_at has some inform afterwards which
> are
> explanation part of the same diagnostics, so should be tied with
> auto_diagnostic_group with it.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK for trunk; I think future such patches can be self-approved as per
the "obvious" rule.

Thanks
Dave

> 
> 2022-10-04  Jakub Jelinek  <jakub@redhat.com>
> 
>         * attribs.cc (handle_ignored_attributes_option,
> decl_attributes,
>         common_function_versions): Use auto_diagnostic_group.
> 
> --- gcc/attribs.cc.jj   2022-10-03 18:31:16.130032566 +0200
> +++ gcc/attribs.cc      2022-10-03 21:27:02.364104260 +0200
> @@ -251,6 +251,7 @@ handle_ignored_attributes_option (vec<ch
>        /* We don't accept '::attr'.  */
>        if (cln == nullptr || cln == opt)
>         {
> +         auto_diagnostic_group d;
>           error ("wrong argument to ignored attributes");
>           inform (input_location, "valid format is %<ns::attr%> or
> %<ns::%>");
>           continue;
> @@ -732,6 +733,7 @@ decl_attributes (tree *node, tree attrib
>               || (spec->max_length >= 0
>                   && nargs > spec->max_length))
>             {
> +             auto_diagnostic_group d;
>               error ("wrong number of arguments specified for %qE
> attribute",
>                      name);
>               if (spec->max_length < 0)
> @@ -1167,6 +1169,7 @@ common_function_versions (tree fn1, tree
>               std::swap (fn1, fn2);
>               attr1 = attr2;
>             }
> +         auto_diagnostic_group d;
>           error_at (DECL_SOURCE_LOCATION (fn2),
>                     "missing %<target%> attribute for multi-versioned
> %qD",
>                     fn2);
> 
>         Jakub
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-04 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04  9:11 [PATCH] attribs: Add missing auto_diagnostic_group 3 times Jakub Jelinek
2022-10-04 12:27 ` David Malcolm

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).