From patchwork Thu Oct 19 15:31:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1851865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fpRYUn4V; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SBBY825Yzz23kQ for ; Fri, 20 Oct 2023 02:32:28 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D76EB385841A for ; Thu, 19 Oct 2023 15:32:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 95FBD3858425 for ; Thu, 19 Oct 2023 15:32:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 95FBD3858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 95FBD3858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697729534; cv=none; b=R9XguWhaH+iayI1uPVb8IYn0fa/b3L2+5bq87n9BAIQJ78QECepqcBSPxqSx4IEDAvP8sMGjeAc7KWbp7kkwNLxTKl2S/+1vaY1mKz3oPlCzbeoCfBSgPfq9sK6y8TOaASujN7sc+bDY69Lsd0TtxrEOkxWcC+ObXM7ITqmiooU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697729534; c=relaxed/simple; bh=d5o1uUCTKbj8l+kfjlWHXpPUUL7polj0eMOeq+R6vLo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ACRR5h9aJULZIiHaqCkw6xOMfCK2fmf1T4W1sJPI1UlkIIMQ86IZiRNL9s9BlDZLd9rlVKAhTUQgEUUooeSyfW5jOExUWnEKQ5u4bUQEU57zdCLWvGY4MEDIOVd+uGkAjX+Ij45ftY78Yj/c6IB6Mf/67MzFf4BMVU6WpdFZyxs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697729533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qj9+pVxEiuMRe1gTw6MYRLsoXoNQTnfXIxMsAYUo5Ho=; b=fpRYUn4VztvHLz7q2Im2SftaJJqJVzNvOst4n2vDWCx7wibQ0vKps5wJC7nuuX02j6TjxG yFJFSavnHAyumlxD39uatMwFhjPmNptT/Hz5+eEn57qsBx3E5GIqLdY4vLhAbrIcwhUMTY e0qGI2jXLhlK0QYDceWPPo40KEG7yTg= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-AB_FNS3KOrSHHFpc8kbMbQ-1; Thu, 19 Oct 2023 11:32:01 -0400 X-MC-Unique: AB_FNS3KOrSHHFpc8kbMbQ-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-41bf9a5930aso31957841cf.2 for ; Thu, 19 Oct 2023 08:32:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697729521; x=1698334321; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qj9+pVxEiuMRe1gTw6MYRLsoXoNQTnfXIxMsAYUo5Ho=; b=m6HaQR+aQbOvb0QRIPkH9WtdU7PqzV2kEnzNIEHNjWyBRYBk7Myui/DrFjfU3tREFk nsqRgfe9/UBIEGMS9tXCqSbtiXTs/3nDgRxvbTVgJXQHfTegS4KWP8ig8wVxWPx+tplP YUJDWH8smCGZdgGh+G7LuPkPOQ0ItXFb32rWmqcMNxFjlzy5egMuUIoymaw/my1Z6vJQ JRxZuYZIOQ/Fu84LsqoTh45LZyDCGXameANhoGZJTRElRyI9bLUV7I0wmQ7lc1qJeoTy 2y6ZZ7mDlH2SBwNO25OGli1lBJS84O1mTmcodyCcjEsnXsQR87wnS+V5GDqODLep48JX teBg== X-Gm-Message-State: AOJu0YxeDRX5QXfY1/sPB5hONFX5MtpDEe8xtxewzbHeq5xUZSf4aedF HDMfNIiGsGi55HX+8K//TyN2F+ibKI6YVv5vVzrESdhI+5k77Qfn5W/7/D8yAjSf9SLwkZ9D7TJ 8wvgNlIXqLii8yUd8KiMCjedD27iVO3dXS/wTtryLzBQcB7XM8SqWEysCNaQ4jyOVmk44vMAisw == X-Received: by 2002:ac8:5795:0:b0:418:eee:15ed with SMTP id v21-20020ac85795000000b004180eee15edmr3116191qta.64.1697729521086; Thu, 19 Oct 2023 08:32:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBtDgJVTTDveMzbvczePjYkTdG7T4a+E4SFouiCCqRKIcUYlx1Pis57u59PoTwu5u+EZTiJw== X-Received: by 2002:ac8:5795:0:b0:418:eee:15ed with SMTP id v21-20020ac85795000000b004180eee15edmr3116145qta.64.1697729520560; Thu, 19 Oct 2023 08:32:00 -0700 (PDT) Received: from jason.com (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id fd3-20020a05622a4d0300b003f6ac526568sm805621qtb.39.2023.10.19.08.31.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 08:32:00 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: use G_ instead of _ Date: Thu, 19 Oct 2023 11:31:58 -0400 Message-Id: <20231019153158.1937301-1-jason@redhat.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested with make po/gcc.pot to see that the strings are still there (though in a different place, now with the gcc-internal-format tag). Applying to trunk. -- 8< -- 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. --- gcc/cp/decl.cc | 4 ++-- gcc/cp/parser.cc | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) base-commit: 04d6c74564b7eb51660a00b35353aeab706b5a50 diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 255c4026bdb..ce4c89dea70 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 57b62fb7363..c77e93ef104 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);