]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostic: rename new permerror overloads
authorJason Merrill <jason@redhat.com>
Thu, 19 Oct 2023 15:23:03 +0000 (11:23 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 19 Oct 2023 15:44:13 +0000 (11:44 -0400)
While checking another change, I noticed that the new permerror overloads
break gettext with "permerror used incompatibly as both
 --keyword=permerror:2 --flag=permerror:2:gcc-internal-format and
 --keyword=permerror:3 --flag=permerror:3:gcc-internal-format".  So let's
change the name.

gcc/ChangeLog:

* diagnostic-core.h (permerror): Rename new overloads...
(permerror_opt): To this.
* diagnostic.cc: Likewise.

gcc/cp/ChangeLog:

* typeck2.cc (check_narrowing): Adjust.

gcc/cp/typeck2.cc
gcc/diagnostic-core.h
gcc/diagnostic.cc

index ab819d4e49d45693f27d2c9096d9feb1eaa8a663..8e63fb1dc0e985ccba1d14c700556e21125948d8 100644 (file)
@@ -1109,9 +1109,9 @@ check_narrowing (tree type, tree init, tsubst_flags_t complain,
       else if (complain & tf_error)
        {
          int savederrorcount = errorcount;
-         permerror (loc, OPT_Wnarrowing,
-                    "narrowing conversion of %qE from %qH to %qI",
-                    init, ftype, type);
+         permerror_opt (loc, OPT_Wnarrowing,
+                        "narrowing conversion of %qE from %qH to %qI",
+                        init, ftype, type);
          if (errorcount == savederrorcount)
            ok = true;
        }
index 2d9909f18bdb4389e1ddaa680514ebedbc6529e4..04eba3d140e64bdf94619b5315db57b568301d92 100644 (file)
@@ -105,9 +105,10 @@ extern bool pedwarn (rich_location *, int, const char *, ...)
 extern bool permerror (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern bool permerror (rich_location *, const char *,
                                   ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern bool permerror (location_t, int, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
-extern bool permerror (rich_location *, int, const char *,
-                      ...) ATTRIBUTE_GCC_DIAG(3,4);
+extern bool permerror_opt (location_t, int, const char *, ...)
+  ATTRIBUTE_GCC_DIAG(3,4);
+extern bool permerror_opt (rich_location *, int, const char *,
+                          ...) ATTRIBUTE_GCC_DIAG(3,4);
 extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
 extern void sorry_at (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
index ecf1097bd2cc229f4edfd3097e25140998749257..0f392358aef618f67195a5b6fdf0eaf3e4b0aba5 100644 (file)
@@ -2027,7 +2027,7 @@ permerror (rich_location *richloc, const char *gmsgid, ...)
    diagnostic can also be downgraded by -Wno-error=opt.  */
 
 bool
-permerror (location_t location, int opt, const char *gmsgid, ...)
+permerror_opt (location_t location, int opt, const char *gmsgid, ...)
 {
   auto_diagnostic_group d;
   va_list ap;
@@ -2041,7 +2041,7 @@ permerror (location_t location, int opt, const char *gmsgid, ...)
 /* Same as "permerror" above, but at RICHLOC.  */
 
 bool
-permerror (rich_location *richloc, int opt, const char *gmsgid, ...)
+permerror_opt (rich_location *richloc, int opt, const char *gmsgid, ...)
 {
   gcc_assert (richloc);