public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4265] diagnostics: Fix selftest ICE in certain locales [PR107722]
Date: Wed, 23 Nov 2022 13:44:26 +0000 (GMT)	[thread overview]
Message-ID: <20221123134426.D9D513854569@sourceware.org> (raw)

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

commit r13-4265-gd601708870ad8dc3ef935e440bf03394891d42e2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Nov 23 14:43:48 2022 +0100

    diagnostics: Fix selftest ICE in certain locales [PR107722]
    
    As reported in the PR, since special_fname_builtin () call has been
    introduced, the diagnostics code compares filename against _("<built-in>")
    rather than "<built-in>", which means that if self tests are performed
    with the string being translated, one self-test fails.
    The following patch fixes that.
    
    2022-11-23  Jakub Jelinek  <jakub@redhat.com>
    
            PR bootstrap/107722
            * diagnostic.cc (test_diagnostic_get_location_text): Test
            special_fname_builtin () rather than "<built-in>" and expect
            special_fname_builtin () concatenated with ":" for it.

Diff:
---
 gcc/diagnostic.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 7c7ee6da746..a9562a815b1 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -2593,7 +2593,10 @@ test_diagnostic_get_location_text ()
   const char *old_progname = progname;
   progname = "PROGNAME";
   assert_location_text ("PROGNAME:", NULL, 0, 0, true);
-  assert_location_text ("<built-in>:", "<built-in>", 42, 10, true);
+  char *built_in_colon = concat (special_fname_builtin (), ":", (char *) 0);
+  assert_location_text (built_in_colon, special_fname_builtin (),
+			42, 10, true);
+  free (built_in_colon);
   assert_location_text ("foo.c:42:10:", "foo.c", 42, 10, true);
   assert_location_text ("foo.c:42:9:", "foo.c", 42, 10, true, 0);
   assert_location_text ("foo.c:42:1010:", "foo.c", 42, 10, true, 1001);

                 reply	other threads:[~2022-11-23 13:44 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=20221123134426.D9D513854569@sourceware.org \
    --to=jakub@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).