From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 4C19C3858C30; Thu, 19 Oct 2023 15:32:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C19C3858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697729531; bh=yC1aA4zZm/aRnOHFFR8zhdi9SdguF9rmq+2LEtshIRQ=; h=From:To:Subject:Date:From; b=Lq+sh5fMD4UzRqDHqntMiGPxvPYr2BXE0oszWaj0YD5zTNU2OT2zvghMt6JDJbBl8 i36FAxPUhYwB+7BDjDVrftjrJ64HA7VqKvLFIB7+ch7z86iX0db+W6BuWWGRo+8l6l tb/AvFg3FHVikzlIAazHw1vxqKts4MdEkafuunS0= 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-4755] c++: use G_ instead of _ X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 04d6c74564b7eb51660a00b35353aeab706b5a50 X-Git-Newrev: f53de2baae5a6992d93d58951c4c0a25ee678091 Message-Id: <20231019153211.4C19C3858C30@sourceware.org> Date: Thu, 19 Oct 2023 15:32:11 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f53de2baae5a6992d93d58951c4c0a25ee678091 commit r14-4755-gf53de2baae5a6992d93d58951c4c0a25ee678091 Author: Jason Merrill Date: Wed Oct 18 14:10:39 2023 -0400 c++: use G_ instead of _ Since these strings are passed to error_at, they should be marked for translation with G_, like other diagnostic messages, rather than _, which forces immediate (redundant) translation. The use of N_ is less problematic, but also imprecise. gcc/cp/ChangeLog: * parser.cc (cp_parser_primary_expression): Use G_. (cp_parser_using_enum): Likewise. * decl.cc (identify_goto): Likewise. Diff: --- gcc/cp/decl.cc | 4 ++-- gcc/cp/parser.cc | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 255c4026bdbd..ce4c89dea705 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -3607,8 +3607,8 @@ identify_goto (tree decl, location_t loc, const location_t *locus, { bool complained = emit_diagnostic (diag_kind, loc, 0, - decl ? N_("jump to label %qD") - : N_("jump to case label"), decl); + decl ? G_("jump to label %qD") + : G_("jump to case label"), decl); if (complained && locus) inform (*locus, " from here"); return complained; diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 57b62fb73631..c77e93ef104f 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -6206,8 +6206,8 @@ cp_parser_primary_expression (cp_parser *parser, { const char *msg = (TREE_CODE (decl) == PARM_DECL - ? _("parameter %qD may not appear in this context") - : _("local variable %qD may not appear in this context")); + ? G_("parameter %qD may not appear in this context") + : G_("local variable %qD may not appear in this context")); error_at (id_expression.get_location (), msg, decl.get_value ()); return error_mark_node; @@ -22145,16 +22145,16 @@ cp_parser_using_enum (cp_parser *parser) shall have a reachable enum-specifier. */ const char *msg = nullptr; if (cxx_dialect < cxx20) - msg = _("% " - "only available with %<-std=c++20%> or %<-std=gnu++20%>"); + msg = G_("% " + "only available with %<-std=c++20%> or %<-std=gnu++20%>"); else if (dependent_type_p (type)) - msg = _("% of dependent type %qT"); + msg = G_("% of dependent type %qT"); else if (TREE_CODE (type) != ENUMERAL_TYPE) - msg = _("% of non-enumeration type %q#T"); + msg = G_("% of non-enumeration type %q#T"); else if (!COMPLETE_TYPE_P (type)) - msg = _("% of incomplete type %qT"); + msg = G_("% of incomplete type %qT"); else if (OPAQUE_ENUM_P (type)) - msg = _("% of %qT before its enum-specifier"); + msg = G_("% of %qT before its enum-specifier"); if (msg) { location_t loc = make_location (start, start, end);