From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 483E3385841B; Thu, 19 Oct 2023 15:49:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 483E3385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697730599; bh=VrBbD+YSfHpqGmxE5ksiDV6oRj+G+uKkaS3c7NEtu9Q=; h=From:To:Subject:Date:From; b=LfXYu13qClRT4oeUpKffRIouow3WlhQhplvKGzQwD9nKVeO6NdE8p7o8XLlJf7Ld7 FgVerxa90m8+LtVEg3/6pMjzMxa5eB9ettgQa2nclbg8PkhPFiUYRwdZF3oHfWQdhR asuvM9pVnv5Cgx9kkm6ipBtm98PvtlBSd28pJZDg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4756] diagnostic: rename new permerror overloads X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/trunk X-Git-Oldrev: f53de2baae5a6992d93d58951c4c0a25ee678091 X-Git-Newrev: 1ec36bcda366732d3d801c67e9f70e2868b7d0e2 Message-Id: <20231019154959.483E3385841B@sourceware.org> Date: Thu, 19 Oct 2023 15:49:59 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1ec36bcda366732d3d801c67e9f70e2868b7d0e2 commit r14-4756-g1ec36bcda366732d3d801c67e9f70e2868b7d0e2 Author: Jason Merrill Date: Thu Oct 19 11:23:03 2023 -0400 diagnostic: rename new permerror overloads 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. Diff: --- gcc/diagnostic-core.h | 7 ++++--- gcc/cp/typeck2.cc | 6 +++--- gcc/diagnostic.cc | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h index 2d9909f18bdb..04eba3d140e6 100644 --- a/gcc/diagnostic-core.h +++ b/gcc/diagnostic-core.h @@ -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); diff --git a/gcc/cp/typeck2.cc b/gcc/cp/typeck2.cc index ab819d4e49d4..8e63fb1dc0e9 100644 --- a/gcc/cp/typeck2.cc +++ b/gcc/cp/typeck2.cc @@ -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; } diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index ecf1097bd2cc..0f392358aef6 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -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);