From patchwork Wed May 4 18:44:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1626503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=pueO3noA; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Ktm3t6ddqz9sBB for ; Thu, 5 May 2022 04:45:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 49CFF3857360 for ; Wed, 4 May 2022 18:45:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49CFF3857360 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1651689927; bh=7qsvIrxZ1su4kyf1XCvYZrC5vz8aGDKpsiHOW1MDDko=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=pueO3noAl+joxWIB11yJO5NWLfzwmi6xcdJ8bvmzEndBuBE/7i9j+FRF6roztmD7J DYBRRYoKWAL30dtNUHQLPK4lUsDoMb5IQs6H5P0kPqdKi9hvu6G0IqfQqnk2cr1kJi 3yx80V+KwfCinI4G8trI42kWRTBkGYffjm6GWWfc= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 76EBC3858D1E for ; Wed, 4 May 2022 18:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 76EBC3858D1E Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-CMLupkaXM-S1E_3OFUQ3LQ-1; Wed, 04 May 2022 14:45:00 -0400 X-MC-Unique: CMLupkaXM-S1E_3OFUQ3LQ-1 Received: by mail-qt1-f200.google.com with SMTP id s26-20020a05622a1a9a00b002f3a45205d2so1720392qtc.0 for ; Wed, 04 May 2022 11:45:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7qsvIrxZ1su4kyf1XCvYZrC5vz8aGDKpsiHOW1MDDko=; b=EFxsX7eT8u2AWADne0P2oWTBUo6zSDoX35Q3CvwFrTHaAz7SGw6gd70rQlnHuA+CsP /dstubKJAv0pewH3BS+SmWceA8/dkbJZqS0Iec0zOf+tzqgoxJcAj/o8NxlaDKBLH1fh qgzMySA1ftdeaFUQRXpTzTaEMa8OuIeFLBD8Xp6QhP0O4S7HGroRN20DvrwxGQiNdrbw H3zk2knDTLmjkGmSKpdrOiZVYnTFAalvumVoWC8qxcB7se76kFZ4kUJ+SCV+QZRFey92 /c3lMfo2oK9pm+z+WsDqYmyWXCK8Qq0lJ2CRbIihzBqxqcDXZogCcwd66c+guvTUPIyL N60A== X-Gm-Message-State: AOAM533hwdLaFJLm3SxhH3vMWEn2/S20Y9ttN4DFboRTuCeHbDs+DHkt gAYlTuCH7nuPXEa7inWm8OPRHs0nC/TQjUVnna+6KOHBwelHIaWqUAJcEaNZN/Wx168ADK4iKxB wk80/FWrxt6DyKswURJIeaBgu/Zt4mtTmi5QljFI5szPk/KyPrQZ87tfdGK5+7+3b/g== X-Received: by 2002:a05:6214:27eb:b0:45a:b022:c97d with SMTP id jt11-20020a05621427eb00b0045ab022c97dmr4904048qvb.24.1651689899363; Wed, 04 May 2022 11:44:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfF3cuV9A7WnAYSbGOo06wV5F/3ECW3CIf4y252ohPSsk490AeV/YUTkaczXyPPt38SuVrdQ== X-Received: by 2002:a05:6214:27eb:b0:45a:b022:c97d with SMTP id jt11-20020a05621427eb00b0045ab022c97dmr4904020qvb.24.1651689899005; Wed, 04 May 2022 11:44:59 -0700 (PDT) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id h23-20020ac85497000000b002f39b99f6b9sm7857900qtq.83.2022.05.04.11.44.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 11:44:57 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: use %D more Date: Wed, 4 May 2022 14:44:54 -0400 Message-Id: <20220504184454.2666319-1-jason@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.4 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" There's no reason to call cxx_printable_name_translate here instead of using %D in the format string. Tested x86_64-pc-linux-gnu, applying to trunk. gcc/cp/ChangeLog: * error.c (cp_print_error_function): Use %qD. (function_category): Use %qD. --- gcc/cp/error.cc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) base-commit: 4a2061610726becfa5158e418c69800f5634b4c1 diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc index 53a9073d99b..2e9dd2c6abd 100644 --- a/gcc/cp/error.cc +++ b/gcc/cp/error.cc @@ -3543,7 +3543,7 @@ cp_print_error_function (diagnostic_context *context, fndecl = current_function_decl; pp_printf (context->printer, function_category (fndecl), - cxx_printable_name_translate (fndecl, 2)); + fndecl); while (abstract_origin) { @@ -3587,19 +3587,19 @@ cp_print_error_function (diagnostic_context *context, { if (context->show_column && s.column != 0) pp_printf (context->printer, - _(" inlined from %qs at %r%s:%d:%d%R"), - cxx_printable_name_translate (fndecl, 2), + _(" inlined from %qD at %r%s:%d:%d%R"), + fndecl, "locus", s.file, s.line, s.column); else pp_printf (context->printer, - _(" inlined from %qs at %r%s:%d%R"), - cxx_printable_name_translate (fndecl, 2), + _(" inlined from %qD at %r%s:%d%R"), + fndecl, "locus", s.file, s.line); } else - pp_printf (context->printer, _(" inlined from %qs"), - cxx_printable_name_translate (fndecl, 2)); + pp_printf (context->printer, _(" inlined from %qD"), + fndecl); } } pp_character (context->printer, ':'); @@ -3613,7 +3613,8 @@ cp_print_error_function (diagnostic_context *context, } /* Returns a description of FUNCTION using standard terminology. The - result is a format string of the form "In CATEGORY %qs". */ + result is a format string of the form "In CATEGORY %qD". */ + static const char * function_category (tree fn) { @@ -3624,20 +3625,20 @@ function_category (tree fn) && DECL_FUNCTION_MEMBER_P (fn)) { if (DECL_STATIC_FUNCTION_P (fn)) - return _("In static member function %qs"); + return _("In static member function %qD"); else if (DECL_COPY_CONSTRUCTOR_P (fn)) - return _("In copy constructor %qs"); + return _("In copy constructor %qD"); else if (DECL_CONSTRUCTOR_P (fn)) - return _("In constructor %qs"); + return _("In constructor %qD"); else if (DECL_DESTRUCTOR_P (fn)) - return _("In destructor %qs"); + return _("In destructor %qD"); else if (LAMBDA_FUNCTION_P (fn)) return _("In lambda function"); else - return _("In member function %qs"); + return _("In member function %qD"); } else - return _("In function %qs"); + return _("In function %qD"); } /* Disable warnings about missing quoting in GCC diagnostics for