public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7999] aarch64: Use error_n for plural text [PR104897]
@ 2022-04-05 16:31 Richard Sandiford
0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2022-04-05 16:31 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e8bc70cc17b0105e2c463a98c9ff76039d03ff60
commit r12-7999-ge8bc70cc17b0105e2c463a98c9ff76039d03ff60
Author: Richard Sandiford <richard.sandiford@arm.com>
Date: Tue Apr 5 17:31:35 2022 +0100
aarch64: Use error_n for plural text [PR104897]
Use error_n rather than error_at for “%d vectors”, so that
translators can pick different translations based on the
number (2 vs more than 2, etc.)
gcc/
PR target/104897
* config/aarch64/aarch64-sve-builtins.cc
(function_resolver::infer_vector_or_tuple_type): Use error_n
for "%d vectors" messages.
Diff:
---
gcc/config/aarch64/aarch64-sve-builtins.cc | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc
index 3381726027d..5d1348afa88 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
@@ -1352,13 +1352,17 @@ function_resolver::infer_vector_or_tuple_type (unsigned int argno,
" expects a single SVE vector rather than a tuple",
actual, argno + 1, fndecl);
else if (size_i == 0 && type_i != VECTOR_TYPE_svbool_t)
- error_at (location, "passing single vector %qT to argument %d"
- " of %qE, which expects a tuple of %d vectors",
- actual, argno + 1, fndecl, num_vectors);
+ /* num_vectors is always != 1, so the singular isn't needed. */
+ error_n (location, num_vectors, "%qT%d%qE%d",
+ "passing single vector %qT to argument %d"
+ " of %qE, which expects a tuple of %d vectors",
+ actual, argno + 1, fndecl, num_vectors);
else
- error_at (location, "passing %qT to argument %d of %qE, which"
- " expects a tuple of %d vectors", actual, argno + 1,
- fndecl, num_vectors);
+ /* num_vectors is always != 1, so the singular isn't needed. */
+ error_n (location, num_vectors, "%qT%d%qE%d",
+ "passing %qT to argument %d of %qE, which"
+ " expects a tuple of %d vectors", actual, argno + 1,
+ fndecl, num_vectors);
return NUM_TYPE_SUFFIXES;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-05 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 16:31 [gcc r12-7999] aarch64: Use error_n for plural text [PR104897] Richard Sandiford
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).