]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
attribs: Add missing auto_diagnostic_group 3 times
authorJakub Jelinek <jakub@redhat.com>
Tue, 4 Oct 2022 19:05:16 +0000 (21:05 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 4 Oct 2022 19:05:16 +0000 (21:05 +0200)
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.

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

index b1f103222aac7ad087b02ad97c4ed4da6ff699f5..1462c1192aebb291540deb9cd72876ab467c9224 100644 (file)
@@ -251,6 +251,7 @@ handle_ignored_attributes_option (vec<char *> *v)
       /* 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 attributes, int flags,
              || (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 fn2)
              std::swap (fn1, fn2);
              attr1 = attr2;
            }
+         auto_diagnostic_group d;
          error_at (DECL_SOURCE_LOCATION (fn2),
                    "missing %<target%> attribute for multi-versioned %qD",
                    fn2);