public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-4755] c++: use G_ instead of _
Date: Thu, 19 Oct 2023 15:32:11 +0000 (GMT)	[thread overview]
Message-ID: <20231019153211.4C19C3858C30@sourceware.org> (raw)

https://gcc.gnu.org/g:f53de2baae5a6992d93d58951c4c0a25ee678091

commit r14-4755-gf53de2baae5a6992d93d58951c4c0a25ee678091
Author: Jason Merrill <jason@redhat.com>
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 = _("%<using enum%> "
-	    "only available with %<-std=c++20%> or %<-std=gnu++20%>");
+    msg = G_("%<using enum%> "
+	     "only available with %<-std=c++20%> or %<-std=gnu++20%>");
   else if (dependent_type_p (type))
-    msg = _("%<using enum%> of dependent type %qT");
+    msg = G_("%<using enum%> of dependent type %qT");
   else if (TREE_CODE (type) != ENUMERAL_TYPE)
-    msg = _("%<using enum%> of non-enumeration type %q#T");
+    msg = G_("%<using enum%> of non-enumeration type %q#T");
   else if (!COMPLETE_TYPE_P (type))
-    msg = _("%<using enum%> of incomplete type %qT");
+    msg = G_("%<using enum%> of incomplete type %qT");
   else if (OPAQUE_ENUM_P (type))
-    msg = _("%<using enum%> of %qT before its enum-specifier");
+    msg = G_("%<using enum%> of %qT before its enum-specifier");
   if (msg)
     {
       location_t loc = make_location (start, start, end);

                 reply	other threads:[~2023-10-19 15:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231019153211.4C19C3858C30@sourceware.org \
    --to=jason@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).