aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/f95-lang.cc
diff options
context:
space:
mode:
authorLewis Hyatt <lhyatt@gmail.com>2022-11-01 18:43:10 -0400
committerLewis Hyatt <lhyatt@gmail.com>2022-11-15 10:50:23 -0500
commit15d315553faafeac849522792b465e522c9d665b (patch)
treeb8764f475372f44fc50b07607ad3d5075e5f7c8e /gcc/fortran/f95-lang.cc
parent6238cc20f0e588f272569230b33458fedf755ab2 (diff)
downloadgcc-15d315553faafeac849522792b465e522c9d665b.zip
gcc-15d315553faafeac849522792b465e522c9d665b.tar.gz
gcc-15d315553faafeac849522792b465e522c9d665b.tar.bz2
diagnostics: Use an inline function rather than hardcoding <built-in> string
The string "<built-in>" is hard-coded in several places throughout the diagnostics code, and in some of those places, it is used incorrectly with respect to internationalization. (Comparing a translated string to an untranslated string.) The error is not currently observable in any output GCC actually produces, hence no testcase added here, but it's worth fixing, and also, I am shortly going to add a new such string and want to avoid hardcoding that one in similar places. gcc/c-family/ChangeLog: * c-opts.cc (c_finish_options): Use special_fname_builtin () rather than a hard-coded string. gcc/ChangeLog: * diagnostic.cc (diagnostic_get_location_text): Use special_fname_builtin () rather than a hardcoded string (which was also incorrectly left untranslated previously.) * input.cc (special_fname_builtin): New function. (expand_location_1): Use special_fname_builtin () rather than a hard-coded string. (test_builtins): Likewise. * input.h (special_fname_builtin): Declare. gcc/fortran/ChangeLog: * cpp.cc (gfc_cpp_init): Use special_fname_builtin () rather than a hardcoded string (which was also incorrectly left untranslated previously.) * error.cc (gfc_diagnostic_build_locus_prefix): Likewise. * f95-lang.cc (gfc_init): Likewise.
Diffstat (limited to 'gcc/fortran/f95-lang.cc')
-rw-r--r--gcc/fortran/f95-lang.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/f95-lang.cc b/gcc/fortran/f95-lang.cc
index a6750be..0d83f3f 100644
--- a/gcc/fortran/f95-lang.cc
+++ b/gcc/fortran/f95-lang.cc
@@ -259,7 +259,7 @@ gfc_init (void)
if (!gfc_cpp_enabled ())
{
linemap_add (line_table, LC_ENTER, false, gfc_source_file, 1);
- linemap_add (line_table, LC_RENAME, false, "<built-in>", 0);
+ linemap_add (line_table, LC_RENAME, false, special_fname_builtin (), 0);
}
else
gfc_cpp_init_0 ();